PIC 999V99The V in the PICTURE indicates that when processing the computer will assume that there is a decimal point in this position. Therefore, the number stored in the PICTURE above would be processed as three whole numbers followed by two decimal places.
PIC 9(6)V99 | 6 whole numbers and 2 decimal places |
PIC V999 | 3 decimal places |
PIC 9(4)V9(4)     | 4 whole numbers and 4 decimal places |
PIC 9(5) | 5 whole numbers |
PIC S9(5) | 5 whole numbers, the sign is remembered |
PIC S9(4)V9 | 4 whole numbers and 1 decimal number, the sign is remembered |
PIC S99V999 | 2 whole numbers and 3 decimal numbers, the sign is remembered |
PIC S999 | 3 whole numbers, the sign is remembered |
Z       | suppresses leading zeros |
. | inserts an actual decimal point in the number |
, | inserts a comma in the number |
$ | inserts a $ in the field - can be fixed or floating |
* | inserts * instead of spaces to suppress leading zeros |
INPUT/WS DATA     | INPUT/WS PIC     | OUTPUT PIC     | OUTPUT DATA     |
---|---|---|---|
000123 | 9999V99 | 9999.99 | 0001.23 |
3455 | 99V99 | Z9.99 | 34.55 |
123456 | 9(4)V99 | Z,ZZ9.99 | 1,234.56 |
01278 | 9(3)V99 | ZZ9.99 | ^12.78 |
00012 | 999V99 | ZZ9.99 | ^^0.12 |
34234 | 9(3)V99 | $ZZ9.99 | $342.34 |
12345678 | 9(6)V99 | $ZZZ,ZZZ.99 | $123,456.78 |
00765432 | 9(6)V99 | $ZZZ,ZZZ.99 | $^^7,654.32 |
765 | 9(3) | ZZ9 | 765 |
23645 | 9(3)V99 | $ZZ9.99 | $236.45 |
0002131 | 9(5)V99 | $ZZ,ZZ9.99 | $^^^^21.31 |
8765432 | 9(5)V99 | $ZZ,ZZ9.99 | $87,654.32 |
7654321 | 9(5)V99 | $$$,$$$.99 | $76,543.21 |
0000123 | 9(5)V99 | $$$,$$$.99 | ^^^^^$1.23 |
0001234 | 9(5)V99 | $$$,$$$.99 | ^^^^$12.34 |
0000045 | 9(5)V99 | $$$,$$$.99 | ^^^^^^$.45 |
124212456 | 9(7)V99 | $$,$$$,$$$.99 | $1,242,124.56 |
12345678 | 9(6)V99 | $$$$,$$$.99 | $123,456.78 |
000234 | 9(4)V99 | $*,***.99 | $****2.34 |
065328 | 9(4)V99 | $*,***.99 | $**653.28 |
87654321 | 9(6)V99 | $***,***.99 | $876,543.21 |
0000064 | 9(5)V99 | $**,***.99 | $******.64 |
0000064 | 9(5)V99 | $**,**9.99 | $*****0.64 |
0000000000 | 9(7)V99 | $*,***,***.99 | $*********.00 |
PIC S999V99With this picture, if the result of the calculation is a negative number or if the input was negative data, the sign will be remembered (Note: In computer code, the sign is stored with the units position). On the output picture, there are a variety of ways to indicate negative data:
- | fixed negative sign either to the left or right of the output picture, will print as space if data is not negative |
----       | floating negative sign to the left of the picture |
+ | fixed positive to the left or right of output picture, turns to - if the data is negative |
++++ | floating positive sign to left of picture, also turns to - if data negative |
DB | to right of picture, prints if data is negative, otherwise two spaces |
CR | to right of picture, prints if is data negative, otherwise two spaces |
INPUT/WS DATA     | INPUT/WS PIC     | OUTPUT PIC     | OUTPUT DATA     |
---|---|---|---|
-67812 | S999V99 | -ZZ9.99 | -678.12 |
45674 | S999V99 | -ZZ9.99 | ^456.74 |
1234 | S9999 | Z,ZZ9- | 1,234^ |
-1234 | S9999 | Z,ZZ9- | 1,234- |
0023 | S9999 | Z,ZZ9- | ^^^23^ |
-0023 | S9999 | Z,ZZ9- | ^^^23- |
-24253 | S9(5) | +ZZ,ZZ9 | -24,253 |
12345 | S9(5) | +ZZ,ZZ9 | +12,345 |
-645642 | S9(4)V99 | +Z,ZZ9.99 | -6,456.42 |
987654 | S9(4)V99 | +Z,ZZZ.99 | +9,876.54 |
-000567 | S9(4)V99 | --,--9.99 | ^^^^-5.67 |
000987 | S9(4)V99 | --,--9.99 | ^^^^^9.87 |
-765793 | S9(4)V99 | --,---.99 | -7,657.93 |
-067834 | S9(4)V99 | --,---.99 | ^^-678.34 |
-0023256 | S9(5)V99 | +++,+++.99 | ^^^-232.56 |
0023256 | S9(5)V99 | +++,+++.99 | ^^^+232.56 | -7867 | S9(4) | Z,ZZ9CR | 7,867CR |
000678 | S9(4)V99 | Z,ZZ9.99CR | ^^^^6.78^^ |
-123345 | S9(4)V99 | Z,ZZ9.99DB | 1,233.45DB |
435454 | S9(4)V99 | Z,ZZ9.99DB | 4,354.54^^ |
INPUT/WS DATA     | INPUT/WS PIC     | OUTPUT PIC     | OUTPUT DATA     |
---|---|---|---|
123456 | 9(3)V99 | ZZZ.99 | 234.56 OR 123.45 |
01 INPUT-REC. 05 FST-FLD-IN PIC XXXX. 05 AMT-IN PIC 9(3)V99. 05 ANOTHER-IN PIC XXXX.If the data on the record is: ABC123456MMMM then FST-FLD-IN = ABC1, AMT-IN = 23456 and ANOTHER-IN = MMMM. This would result in the output 234.56.
INPUT/WS DATA     | INPUT/WS PIC     | OUTPUT PIC     | OUTPUT DATA     |
---|---|---|---|
12345 | 9(3)V99 | ZZZ.9 | 123.4 |
INPUT/WS DATA     | INPUT/WS PIC     | OUTPUT PIC     | OUTPUT DATA     |
---|---|---|---|
1234 | 99V99 | Z,ZZ9 | ^^^12 |
INPUT/WS DATA     | INPUT/WS PIC     | OUTPUT PIC     | OUTPUT DATA     |
---|---|---|---|
1234 | 9999 | Z,ZZ9.99 | 1,234.00 |
INPUT/WS DATA     | INPUT/WS PIC     | OUTPUT PIC     | OUTPUT DATA     |
---|---|---|---|
1234 | 999V9 | ZZZ.99 | 123.40 |
INPUT/WS DATA     | INPUT/WS PIC     | OUTPUT PIC     | OUTPUT DATA     |
---|---|---|---|
234567 | 9(5)V9 | Z,ZZZ.99 | 3,456.70 |
-1234 | 9999 | -Z,ZZ9 | ^1,234 |
-7654 | S9999 | Z,ZZ9 | 7,654 |
20034 | 9(4) | $*,***.99 | $2,003.00 OR $***34.00 |
76543 | 999V99 | ZZ,ZZ9 | ^^^765 |
100234 | 9(4)V99 | ZZ9.99 | ^^2.34 |