*---------*---------------*-----------------*----------------*---------------* | CODE | FACTOR 1 | FACTOR 2 | RESULT | INDICATORS | | | | | FIELD | | *---------*---------------*-----------------*----------------*---------------* | OUT | *LOCK | Data area name | | _ ER _ | *---------*---------------*-----------------*----------------*---------------*
The OUT operation updates the data area specified in factor 2. To specify a data area in factor 2 of an OUT operation, you must ensure two things:
Factor 1 can contain the reserved word *LOCK or can be blank. When factor 1 contains *LOCK, the data area remains locked after it is updated. When factor 1 is blank, the data area is unlocked after it is updated.
Factor 1 must be blank when factor 2 contains the name of the local data area or the Program Initialization Parameters (PIP) data area.
Factor 2 must be the name of the data area to be updated or must be the reserved word *NAMVAR. When *NAMVAR is specified, all data areas defined in the program are updated. If an error occurs when one or more data areas are updated (for example, if you specify an OUT operation to a data area that has not been locked by the program), an error occurs on the OUT operation and the RPG/400 exception/error handling routine receives control. If you specify a program exception/error subroutine (*PSSR), the program status data structure contains information on the data area in error. If a message is issued to the requester, the message identifies the data area in error.
You can specify a resulting indicator in positions 56 and 57 to be set on if an error occurs during the operation. Positions 54-55 and 58-59 must be blank.
For further rules for the OUT operation, see Data-Area Operations.
See Figure "IN and OUT Operations" for an example of the OUT operation.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.