Rational Developer for System z
COBOL for Windows, Version 7.5, Programming Guide


Displaying values on a screen or in a file (DISPLAY)

You can display the value of a data item on a screen or write it to a file by using the DISPLAY statement.

Display “No entry for surname '” Customer-Name “' found in the file.”.

In the example above, if the content of data item Customer-Name is JOHNSON, then the statement displays the following message on the screen:

No entry for surname 'JOHNSON' found in the file.

To write data to a destination other than the screen, use the UPON phrase. For example, the following statement writes to the file that you specify as the value of the SYSOUT environment variable:

Display “Hello” upon sysout.

When you display the value of a USAGE NATIONAL data item, the output data is converted to the code page that is associated with the current locale.

related concepts
Unicode and the encoding of language characters

related tasks
Converting national data to alphanumeric data (DISPLAY-OF)
Coding COBOL programs to run under CICS

related references
Runtime environment variables
DISPLAY statement (COBOL for Windows Language Reference)


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)