Picture specification characters

A picture specification consists of a sequence of picture characters enclosed in single or double quotation marks. This character describes the contents of each position of the character or numeric character data item, and the contents of the output.

The specification can be made in two ways:

A picture specification describes either a character data item or a numeric character data item. The presence of an A or X picture character defines a picture specification as a character picture specification; otherwise, it is a numeric character picture specification.

A character pictured item can consist of alphabetic characters, decimal digits, blanks, currency and punctuation characters.

A numeric character pictured item can consist only of decimal digits, an optional decimal point, an optional letter E, and, optionally, one or two plus or minus signs. Other characters generally associated with arithmetic data, such as currency symbols, can also be specified, but they are not part of the arithmetic value of the numeric character variable, although the characters are stored with the digits and are part of the character value of the variable.

Figures in this section illustrate how different picture specifications affect the representation of values when assigned to a pictured variable or when printed using the P-format item. Each figure shows the original value of the data, the attributes of the variable from which it is assigned (or written), the picture specification, and the character value of the numeric character or pictured character variable.






Published: 23 December 2018