+-------------------------------IBM Extension--------------------------------+
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.
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.
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.
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-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).
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.
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.
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.
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----------------------------+
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.