To display the values of fields on an output device.
DISPLAY [DATA] (display-item [[,] display-item]...) [UPON Name];
You can omit the keyword DATA, and the commas between display items. Each display-item is a field reference, a string constant, or a number.
If UPON is present, then Name must be one of the special
COBOL names CONSOLE, SYSOUT, SYSLIST, SYSLST, SYSPUNCH, SYSPCH, SYSIN, SYSIPT. If UPON is absent, then output is written to
SYSOUT.
For example
DISPLAY('TEST. IX1:' JZ.IX1);
This produces output like this on SYSOUT: -
TEST. IX1:00001
TEST. IX1:00002
TEST. IX1:00003
TEST. IX1:00004
TEST. IX1:00005
TEST. IX1:00006
DISPLAY has been implemented to simplify conversion from Easytrieve. COBOL programmers are familiar with it and may like to continue using it for debugging and similar purposes. But they should consider the use of PRINT, particularly PRINT …. FIELDTABLE, as these provide more information for debugging and give more control over output format.
DISPLAY does not support SKIP and COL options. If these are wanted, replace the DISPLAY with a PRINT, e.g. this statement was converted from an EZT DISPLAY statement: -
DISPLAY(SKIP 1 COL 13 'TOTAL DA MINUTA' COL
49 EZT-MX600A06-Data.W-DEB
COL 74 EZT-MX600A06-Data.W-CRED);
#035 S SKIP
not found
#035 S COL
not found
#035 S COL
not found
#035 S COL not found
It can be
rewritten as this PRINT
statement: -
PRINT('TOTAL DA MINUTA' COL 13, EZT-MX600A06-Data.W-DEB COL
49, EZT-MX600A06-Data.W-CRED
COL 74 ) SPACE(1) REPORT(2);
COL options
follow the relevant item, and SKIP becomes SPACE and is placed outside the DATA option.
If we want this printing to be separate from other printed output, then we’d add a unique REPORT number
and define the report like
REPORT(2) NAME 'SPNAME' NOHEADING;
#726 W SPNAME will be assigned to RepNbr2
DISPLAY can
only use the COBOL special names, a REPORT for printing must not use them.
EZT conversion from lines like
DISPLAY SYS012 E1-SATZ 'F1: VK nicht gefunden' V05-LEV
may insert a REPORT statement like
REPORT NAME 'SYSLST' DISPLAY EZTNAME 'SYS012';
to reserve the name for further DISPLAY SYS012 statements as it adds UPON SYSLST to the DISPLAY
statement.
For more information, see https://www.jazzsoftware.co.nz/Docs/JazzLRM_REPORT.htm#Report_Display