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

Example

  dcl source char value("Ein Raetsel gibt es nicht.");
  dcl target char(length(source));
  dcl (to   value ('ABCDEFGHIJKLMNOPQRSTUVWXYZ'),
       from value ('abcdefghijklmnopqrstuvwxyz')) char;

  target = translate(source, to, from);
           /* "EIN RAETSEL GIBT ES NICHT." */

Note that you could also use the UPPERCASE built-in for the same purpose as the TRANSLATE built-in in the example above. However, while the UPPERCASE built-in function will translate only the standard alphabetic characters, TRANSLATE can be used to translate other characters. For example, if "Raetsel" were spelled with an a-umlaut, TRANSLATE could translate the a-umlaut to A-umlaut if those characters were added to the from and to strings, respectively.


Terms of use | Feedback

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