ILE COBOL Language Reference

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

Format 5 - Data Area

This statement is used to transfer data to the data area specified in the FOR phrase.

DISPLAY Statement - Format 5 - Data Area
 
            .------------------.
            V                  |
>>-DISPLAY----+-identifier-1-+-+--UPON--mnemonic-name----------->
              '-literal-1----'
 
>--FOR-+-identifier-2-+----------------------------------------->
       '-literal-2----'
 
>--+-----------------------------------+------------------------>
   '-+----+--LIBRARY--+-identifier-3-+-'
     '-IN-'           '-literal-3----'
 
>--+----------------------+--+-----------+---------------------->
   '-AT--+-identifier-4-+-'  '-WITH LOCK-'
         '-integer-1----'
 
>--+-------------------------------------------+---------------->
   '-+----+--EXCEPTION--imperative-statement-1-'
     '-ON-'
 
>--+------------------------------------------------+----------->
   '-NOT--+----+--EXCEPTION--imperative-statement-2-'
          '-ON-'
 
>--+-------------+---------------------------------------------><
   '-END-DISPLAY-'
 
 

This format is only applicable when the mnemonic-name in the SPECIAL-NAMES paragraph is associated with the environment-name DATA-AREA.

The DISPLAY statement's literal operands, or the contents of the DISPLAY statement's identifier operands, are written to the data area according to the rules of the MOVE statement for a group move without the CORRESPONDING phrase, and without padding on the right with spaces.

identifier-1/literal-1
The conversion and display rules for identifier-1 and literal-1 are described under Format 1 - Data Transfer.

Identifier-1 can be date-time data item.

UPON

mnemonic-name in the SPECIAL-NAMES paragraph must be associated with the environment-name DATA-AREA.

When the UPON phrase is omitted, the DISPLAY statement sends output to the REQUESTOR.

FOR Phrase

Identifies the operating system data area to which to write information. If the data area specified cannot be located or accessed at run time an ON EXCEPTION condition exists.

identifier-2
Must be an alphanumeric data item. The contents of identifier-2 must represent a valid operating system data area name. Operating system data area names are at most 10 characters long, thus the first 10 characters of identifier-2 are used to form the data area name.
literal-2
Must be nonnumeric and at most 10 characters long.

IN LIBRARY Phrase

Is used to specify the name of the operating system library in which the data area is to be found. The special values *LIBL (search using the job's library list) or *CURLIB (search the current library) may be specified. If the LIBRARY phrase is omitted, the job's library list is used to search for the data area.

identifier-3
Must be an alphanumeric data item. Since operating system library names are at most ten characters long , only the first ten characters of identifier-3 are used to form the library name.
literal-3
Must be nonnumeric and at most 10 characters long.

Identifier-2, identifier-3, literal-1, and literal-2 are not affected by the *MONOPRC compiler option. They can contain an operating system quoted name (for details, see "Rules for Specifying Names" 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).

AT Phrase

The AT phrase indicates the starting position in the data area to which text is written.

If the AT phrase is not specified, a starting position of 1 is assumed.

identifier-4, integer-1
Identifier-4 and integer-1 must be positive numeric integers with a value that ranges from 1 to the maximum data area size (2000).

WITH LOCK Phrase

Before data is transferred to the specified data area in the FOR phrase, a lock must be obtained. If a lock cannot be obtained, the data is not transferred, and an ON EXCEPTION condition exists.

To maintain a lock on the data area after the transfer of data, specify this phrase. If a lock existed on the data area prior to this statement and the statement did not contain a WITH LOCK phrase, the lock is released.

(NOT) ON EXCEPTION

If an error occurs while accessing the data-area, any imperative statement specified in the ON EXCEPTION phrase is processed. In the absence of the ON EXCEPTION phrase, a run time message is issued. If the data area is accessed successfully, any imperative statement specified in the NOT ON EXCEPTION phrase is processed.

END-DISPLAY Phrase

The END-DISPLAY explicit scope terminator serves to delimit the scope of the DISPLAY statement. END-DISPLAY permits a conditional DISPLAY statement to be nested in another conditional statement. END-DISPLAY can also be used with an imperative DISPLAY statement. For more information, see Delimited Scope Statements.

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


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