COBOL DISPLAY statement is used to show the output
Most used format/syntax:1
DISPLAY “I AN AM EXAMPLE OF MOST USED SIMPLE COBOL DISPLAY: “
OUTPUT:
I AN AM EXAMPLE OF MOST USED SIMPLE COBOL DISPLAY:
Most used format/syntax:2
DISPLAY “I AN AM EXAMPLE OF MOST USED COBOL DISPLAY WITH VALUE: ” WS-DISPLAY.
If the value of WS-DISPLAY is 100, then
OUTPUT:
I AN AM EXAMPLE OF MOST USED SIMPLE COBOL DISPLAY WITH VALUE: 100
Most used format/syntax:3
DISPLAY WS-DISPLAY.
If the value of WS-DISPLAY is 100, then
OUTPUT:
100
Let us take an example of a DISPLAY statement.
Output
Less used format/syntax:4
DISPLAY “I AN AM EXAMPLE OF LESS USED DISPLAY WITH NO ADVANCING: ” WITH NO ADVANCING
OUTPUT:
I AN AM EXAMPLE OF LESS USED DISPLAY WITH NO ADVANCING: ====> Cursor is Placed after ‘:’
Note:
If ‘WITH NO ADVANCING’ option is defined, the current position of the cursor will be placed after the last character of the display statement.
If ‘WITH NO ADVANCING’ option is not defined, the current cursor position will be in the next line of the display statement.