Wednesday 19 August 2015

COBOL Editing data items

Z : Replaces all leading zeros with spaces
Ex. PIC  ZZ999
$ : One dollar character will be added at left most position
Ex. PIC $999
*(Asterisk) : Similar to Z, the leading zeros will be replaced with *
Ex. PIC **999
0(Zero) : Inserts zero at specified position.
Ex. PIC 999.00
B(BLANK) : Insert a blank at particular position.
Ex. PIC AABAA
BLANK WHEN ZERO : Display blank when the value of the variable is zero
Ex. PIC 99.99 BLANK WHEN ZERO
/(SLASH) : Insert slash at specific position
Ex. PIC 99/99/9999
,(Comma) : Insert comma at specific position
Ex. PIC 99,99,9999
.(Period) : Denotes decimal point in the numeric value.
Ex. PIC 99.99
-(Minus) : One sign ‘-‘ is allowed in the data item
Ex. PIC -999 OR 999-
+(Plus) : One sign ‘+‘ is allowed in the data item
Ex. PIC +999 OR 999+

No comments:

Post a Comment