Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Language Reference Manual

Example

  dcl Source char value (' 555 Bailey Ave, San Jose, CA 95141, USA');
  dcl Digits char value ('0123456789');
  dcl (Start, End) fixed bin(31);
  dcl Num char(20) var;

     /*   Find last number (i.e., zip code)    */

  End   = searchr (Source, Digits);        /* returns 35 for the '1' */
  Start = verifyr (Source, Digits, End);   /* returns 30 for the ' ' */
  Num   = substr (Source, Start + 1, End - Start);  /* extract number */

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)