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

G-format item

For the compiler, the graphic (or G) format item describes the representation of a graphic string.

Read syntax diagramSkip visual syntax diagram>>-G--+---------------+----------------------------------------><
      '-(field-width)-'
 
field-width
Specifies the number of 2-byte positions in the data stream that contain (or will contain) the graphic string. It is an expression that is evaluated and converted to an integer value, which must be nonnegative, each time the format item is used. End-of-line must not occur between the 2 bytes of a graphic.

On input, the specified number of graphics is obtained from the data stream and assigned, with any necessary truncation or padding, to the data-list item. The field-width is always required on input, and if it is zero, a null string is obtained.

On output, the data-list item is truncated or extended (with the padding graphic) on the right to the specified field-width before being placed into the data stream. No enclosing quotation marks are inserted, nor is the identifying suffix, G, inserted. If the field-width is zero, no graphics are placed into the data stream. If the field-width is not specified, it defaults to be equal to the graphic-string length of the data-list item.

In the following example, if file OUT has the GRAPHIC option, six bytes are transmitted.

  declare A graphic(3);
  put file(Out) edit (A) (G(3));

Terms of use | Feedback

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