COBOL Manual for TNS and TNS/R Programs

Data Division
HP COBOL Manual for TNS and TNS/R Programs522555-006
7-88
BLANK WHEN ZERO Clause
Usage Considerations:
Effect of RIGHT on Compilation
The optional keyword RIGHT has no effect on the compilation, and serves only to
provide emphasis.
Trailing Spaces Are Not Ignored
Trailing spaces in a data item are not ignored when the data item is moved to a
right-justified field. For example,
77 F1 PIC X(3) JUSTIFIED RIGHT.
77 F2 PIC X(2) VALUE "A".
MOVE F2 TO F1.
gives F1 the value
" A "
not the value
" A"
BLANK WHEN ZERO Clause
The BLANK WHEN ZERO clause fills an item with spaces when its value is 0.
You can use the BLANK WHEN ZERO clause only with elementary numeric or
elementary numeric edited data items. This clause revises the category of a numeric
item to numeric edited; therefore, the item must be USAGE DISPLAY.
The BLANK WHEN ZERO clause cannot be used for national data items.
Note. The JUSTIFIED clause has no effect on initialization by the VALUE clause.
Note. The BLANK WHEN ZERO clause has no effect on initialization by the VALUE clause.
BLANK
WHEN
ZERO
VST246.vsd