DISPLAY and formatting
| DISPLAY | |
| EDITED pictures | |
| Line control |
DISPLAY
DISPLAY writes one line to the standard output. Several items in one DISPLAY are concatenated with a single space between them, and a trailing period ends the sentence:
DISPLAY "Employee: " WS-NAME " Rate: " WS-RATE.
EDITED pictures
Edited pictures format numbers for people: Z prints a blank instead of a leading zero, * fills with asterisks for currency, . places the decimal point, and CR shows a negative credit:
01 WS-SALARY-OUT PIC $$$,$$$,$$9.99.
MOVE WS-SALARY TO WS-SALARY-OUT.
DISPLAY "Salary: " WS-SALARY-OUT.
Line control
For report files, LINE-COUNTER and LINAGE-COUNTER track the page, and WRITE with AFTER ADVANCING controls spacing. Keep DISPLAY for debugging and the Report Writer for finished output.
Next: ACCEPT and the SCREEN section
Article author: Arthur Isaev