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 can be one of the special
COBOL names CONSOLE, SYSOUT, SYSLIST, SYSLST, SYSPUNCH, SYSPCH, SYSIN, SYSIPT, or
it may be the name of an output file suitably defined for use with a DISPLAY
statement. 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.