The rules for using numeric picture data are as follows:
DECLARE A PICTURE 'ZZZV.ZZ'; DECLARE B PICTURE '***V.**CR';
In this example, a value of . 01 assigned to A and B produces and .. A value of zero assigned to A and B produces and ********.
DECLARE A PICTURE 'ZZZV.ZZ' DECLARE B PICTURE '---V.z--'
In this example, A has a precision of (5,2), while B has a precision of (4,2).
Following are more examples of picture format output.
Example | Data | Picture | Output |
---|---|---|---|
1 | 12345.60 | $SSSSSSSSV.99 | $ +12345.60 |
2 | 1.23 | **********V.99 | .********1.23 |
3 | 1.23 | ZZZZZZZZZZV.99S | 1.23 |
4 | 1234.56 | Z.ZZZ ZZZV,99 | 1.234,56 |
5 | 11011111 | 9999B9999 | 1101 1111 |
6 | 011335 | **/**/** | *1/13/35 |
7 | 1234567890 | 999999999V.99 | 234567890.00 |
8 | .33 | ZV.ZZ | .33 |
9 | .75 | ZV.ZZ | .75 |
10 | 1234567.89 | $999,999,999V.99DB | $001,234,567.89 |
11 | -1234567.89 | $999,999,999V.99CR | $001,234,567.89CR |
12 | 1023 | YYYYY | 1 23 |
In example 1, '$' is a static character because it appears only once, whereas 'S' is a drifting character because it appears all the way to the decimal.
In examples 2, 3, and 4, the characters 'Z' and '*' are zero-suppression characters. The asterisk prints wherever a zero or blank would have printed, and the 'Z' substitutes blanks.
In example 5 the insertion character 'B' results in a space (blank). A blank is inserted wherever the 'B' appears in the numeric picture format unless it is in a field of zero-suppression characters that are suppressing zeros at the time.
In example 7, the appearance of the character '9' results in the printing of a digit. All digits 0 through 9 are printed, except the leading one, which is truncated.
In examples 8 and 9, the character 'V', once encountered, turns off suppression; all characters after the 'V' are printed. Note that in Example 8, 'V' is not used before the decimal point, so the point is turned off, not on.
Examples 10 and 11 show the result of positive and negative data applied to numeric pictures that contain either 'CR' or 'DB'.