For the compiler, the graphic (or G) format item describes the representation of a graphic string.
|
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));