ILE COBOL Language Reference

DISPLAY Statement Behavior

The DISPLAY statement transfers the data in the sending field to the output device. The size of the sending field is the total character count of all operands listed. If the hardware device is capable of receiving data of the same size as the data item being transferred, then the data item is transferred. If the hardware device is not capable of receiving data of the same size as the data item being transferred, then one of the following applies:

After the last operand has been transferred to the output device, the device is reset to the leftmost position of the next line of the device.

The logical record length depends on the device as follows:

Output Maximum Logical Record Size
Job log 120 characters
Workstation 58 characters
System operator's message queue 58 characters

+-------------------------------IBM Extension--------------------------------+

If a DBCS or national item or literal is specified in a DISPLAY verb, the size of the sending field is the total character count of all operands listed, with each DBCS or national character counted twice, plus all necessary shift codes for DBCS.

+----------------------------End of IBM Extension----------------------------+

When a program in a batch job processes a DISPLAY statement without the UPON phrase, or with an UPON phrase associated with the REQUESTOR, the output is sent to the job log in an informational message of severity 99. You can change the severity of this message using the Change Message Description (CHGMSGD) CL command. For more information, see theCL and APIs section of the Programming category in the iSeries Information Center at this Web site -http://www.ibm.com/eserver/iseries/infocenter

For an interactive job that uses display device files, DISPLAY statements are not normally used. If you do use them, the following considerations apply.

When an interactive job processes a DISPLAY statement, the logical record appears on the screen in the Program Messages display.

The following screen shows a sample Program Messages display.


+--------------------------------------------------------------------------------+
|                                                                                |
|                          Display Program Messages                              |
|                                                                                |
|JOB 000745/QPGMR/WS1 started on 02/17/92 at 14:50:22 in subsystem QINTER(1)     |
|SAMPLE PROGRAM MESSAGE FROM PREVIOUS CALL OF PROGRAM.(2)                        |
|SAMPLE PROGRAM MESSAGE FROM CURRENT CALL OF PROGRAM.(2)                         |
|                                                                                |
|                                                                                |
|                                                                                |
+--------------------------------------------------------------------------------+

This display contains messages from the current program processing, as well as messages relating to other activities in the session.

When a DISPLAY statement is processed, the characteristics of the display device file on the screen determine whether or not to suspend program processing:

To view output records after the program terminates, press the F10 key from the Command Entry display.

For additional information on interactive processing, see the ILE COBOL for AS/400 Programmer's Guide . For additional information on the RSTDSP parameter, see the CHGDSPF and CRTDSPF commands in the CL and APIs section of the Programming category in the iSeries Information Center at this Web site -http://www.ibm.com/eserver/iseries/infocenter.

When a program started by a workstation operator sends a DISPLAY to the system operator's message queue (separate from the workstation), program processing is not suspended.

The location of the output data is dependent upon the type of program initiation as follows:

Method of Initiation Mnemonic-Name Associated with SYSTEM-CONSOLE Mnemonic-Name Associated with REQUESTOR UPON Phrase Omitted
BATCH System operator's message queue Job log Job log
INTERACTIVE System operator's message queue Workstation Workstation


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]