The following examples illustrate the use of a PICTURE clause. These edit patterns refer to numeric columns with a length of five digits. In the first column are sample PICTURE clauses. The other three columns show what the output looks like using the PICTURE clause in the first column and the data appearing at the top of each column.
|
PICTURE Clause |
9876.5 |
0012.3- |
0000.9 |
|---|---|---|---|
|
PIC '9999.9-' |
9876.5 |
0012.3- |
0000.9 |
|
PIC 'ZZZZ.Z-' |
9876.5 |
12.3- |
0.9 |
|
PIC 'ZZZ9.9-' |
9876.5 |
12.3- |
0.9 |
|
PIC '****.*CR' |
9876.5 |
**12.3 CR |
****.9 |
|
PIC '$$$$$.$CR' |
$9876.5 |
$12.3 CR |
$.9 |
|
PIC '$$$$9.9CR' |
$9876.5 |
$12.3 CR |
$0.9 |
|
Copyright © 2014 CA.
All rights reserved.
|
|