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

Example

  dcl x char(20);
  dcl y char(20) varying;

  x, y = '';

  x = copy( '*', length(x) );    /* fills x with '*'   */
  y = copy( '*', length(y) );    /* leaves y unchanged */

  x = copy( '-', maxlength(x) ); /* fills x with '-'   */
  y = copy( '-', maxlength(y) ); /* fills y with '-'   */

Note that the first assignment to y leaves it unchanged because length(y) will return zero when it is used in the code snippet above (since y is VARYING and was previously set to '').

However, the second assignment to y fills it with 20 - signs because maxlength(y) will return 20 (the declared length of y).


Terms of use | Feedback

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