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
When DISPLAY names a numeric field, as here, the field will be displayed with its Display Picture (DPIC) which is inferred from the field’s format unless there is an explicit DPIC option. Thus with FIELD2 defined
FIELD2 PIC 'S999V99' VALUE -158.49,
output from
DISPLAY('FIELD2:' EZT-SAMPL-Data.FIELD2
':');
is
FIELD2:-158.49:
with - because FIELD2 is negative, and the decimal position identified
by a period.
If you want some other display format, add DPIC to the field definition. For
example, with field
definitions edited to
FIELD5
PIC 'S9(5)' VALUE 135 DPIC '99999',
FIELD6
PIC 'S9(5)' VALUE -158 DPIC '99999',
data is printed as
FIELD5:00135:
FIELD6:00158:
If
the first field in the data list is a file name (type F, FB, V, VB, U, VSAM, ESDS, or SQL) and the DISPLAY was written without an UPON option, then MANASYS Jazz
assumes that this DISPLAY statement has been converted from an Easytrieve
statement like
DISPLAY SYSLIST SYSDATE ';' WS-DATE
and so should be converted to
DISPLAY(JZEZT.SYSDATE ';' EZT-DISPFLR2-Data.WS-DATE) UPON SYSLIST;
If the EZT file name is NOT one of the allowed COBOL special names (CONSOLE, SYSOUT, SYSLIST, SYSLST, SYSPUNCH, SYSPCH, SYSIN, SYSIPT), for example
DISPLAY OUTFILE SYSDATE ';' WS-DATE
then one of the special names will be used
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. For example, 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