Picture data represents fixed-point decimal or character values that are stored internally as character strings. The strings contain the characters that represent the numeric or character values in a specified-format (as indicated by special embedded symbols, such as a period or a comma).
Picture data is best used to manipulate a string or numeric quantity arithmetically and then print or display its value using a special output format.
A pictured value is any value whose data type is either declared by a PICTURE attribute or is acquired by the P format in a FORMAT statement. Picture characters are the special characters that make up the picture specification in the PICTURE attribute and in the P format item. Following are examples of picture specifications declared by the PICTURE attribute:
DECLARE F PICTURE '$ZZ,ZZZV.99CR'; DECLARE G PICTURE '$$$,$$$V.99-'; DECLARE H PICTURE '$**,***V.999'; DECLARE I PICTURE '----9V.999'; DECLARE J PICTURE '9999V9999S';
If the value -1234.56 was assigned to each of the variables in these examples, the resulting picture values would be as follows:
Repetition factors can be used for sequences of identical picture characters. For example, the following declaration of J is equivalent to the one given above:
DECLARE J PICTURE '(4)9V(4)9S';