The picture characters comma (,), point (.), slash (/), and blank (B) cause the specified character to be inserted into the associated position of the numeric character data. They do not indicate digit or character positions, but are inserted between digits or characters. Each does, however, actually represent a character position in the character value, whether or not the character is suppressed. The comma, point, and slash are conditional insertion characters and can be suppressed within a sequence of zero suppression characters. The blank is an unconditional insertion character, and always specifies that a blank appears in the associated position.
Insertion characters are applicable only to the character value. They specify nothing about the arithmetic value of the data item. They never cause decimal point or decimal comma alignment in the picture specifications of a fixed-point decimal number and are not a part of the arithmetic value of the data item. Decimal alignment is controlled by the picture characters V and F.
In all other cases where zero suppression occurs, a comma, point, or slash insertion character is treated as a zero suppression character identical to the preceding character.
The point, comma, or slash can be used in conjunction with the V to cause insertion of the point (or comma or slash) in the position that delimits the end of the integer portion in and the beginning of the fractional portion of a fixed-point (or floating-point) number, as might be desired in printing, since the V does not cause printing of a point. The point must immediately precede or immediately follow the V. If the point precedes the V, it is inserted only if an unsuppressed digit appears to the left of the V, even if all fractional digits are significant. If the point immediately follows the V, it is suppressed if all digits to the right of the V are suppressed, but it appears if there are any unsuppressed fractional digits (along with any intervening zeros).
The following example shows decimal conventions that are used in different countries.
declare A picture 'Z,ZZZ,ZZZV.99',
B picture 'Z.ZZZ.ZZZV,99',
C picture 'ZBZZZBZZZV,99';
A,B,C = 1234;
A,B,C = 1234.00;
A, B, and C represent nine-digit numbers with a decimal point or decimal comma assumed between the seventh and eighth digits. The actual point specified by the decimal point insertion character is not a part of the arithmetic value. It is, however, part of its character value. The two assignment statements assign the same character value to A, B, and C as follows:
1,234.00 /* value of A */ 1.234,00 /* value of B */ 1 234,00 /* value of C */
In the following example, decimal point alignment during assignment occurs on the character V. If Rate is printed, it appears as '762.00', but its arithmetic value is 7.6200.
declare Rate picture '9V99.99'; Rate = 7.62;
Table 38 shows examples of insertion characters.
|
Source Attributes |
Source Data (in constant form) |
Picture Specification |
Character Value |
|---|---|---|---|
|
FIXED(4) FIXED(6,2) FIXED(4,2) |
1234 1234.56 12.34 |
9,999 9,999V.99 ZZ.VZZ |
1,234 1,234.56 12.34 |
|
FIXED(4,2) FIXED(4,2) FIXED(4,2) |
00.03 00.03 12.34 |
ZZ.VZZ ZZV.ZZ ZZV.ZZ |
bbb03 bb.03 12.34 |
|
FIXED(4,2) FIXED(9,2) FIXED(7,2) |
00.00 1234567.89 12345.67 |
ZZV.ZZ 9,999,999.V99 **,999V.99 |
bbbbb 1,234,567.89 12,345.67 |
|
FIXED(7,2) FIXED(9,2) FIXED(6) |
00123.45 1234567.89 123456 |
**,999V.99 9.999.999V,99 99/99/99 |
***123.45 1.234.567,89 12/34/56 |
|
FIXED(6) FIXED(6) FIXED(6) |
123456 001234 000012 |
99.9/99.9 ZZ/ZZ/ZZ ZZ/ZZ/ZZ |
12.3/45.6 bbb12/34 bbbbbb12 |
|
FIXED(6) FIXED(6) FIXED(6) |
000000 000000 000000 |
ZZ/ZZ/ZZ **/**/** **B**B** |
bbbbbbbb ******** **b**b** |
|
FIXED(6) FIXED(3) FIXED(2) |
123456 123 12 |
99B99B99 9BB9BB9 9BB/9BB |
12b34b56 1bb2bb3 1bb/2bb |