RPG/400 Help
The data area operations are:
The IN and OUT operations allow you to retrieve and write one or all data
areas in a program, depending on the factor 2 entry.
The IN and OUT operations also allow you to control the locking or
unlocking of a data area. When a data area is locked, it can be read
but not updated by other programs.
The following lock states are used:
- For an IN operation with *LOCK specified, an exclusive allow read lock
state is placed on the data area.
- For an OUT or UNLCK operation, the exclusive allow read lock state is
released.
During the actual transfer of data into or out of a data area, there is a
system-internal lock on the data area. If several users are contending
for the same data area, a user may get an error message indicating that the
data area is not available.
Remember the following when using the IN, OUT, and UNLCK operations:
- A data-area operation cannot be done on a data area that is not defined to
the operating system.
- Before the IN, OUT, and UNLCK operations can be done on a data area, you
must specify that data area in the result field of an *NAMVAR DEFN
statement. (For further information on the DEFN statement, see DEFN (Field Definition).)
- The data-area operations can be done on a data-area data structure that is
implicitly retrieved only if the data-area data structure name is specified in
the result field of an *NAMVAR DEFN statement.
- A locked data area cannot be updated or locked by another RPG/400
program; however, the data area can be retrieved in your own program by
an IN operation with factor 1 blank.
- A data-area name cannot be the name of a multiple-occurrence data
structure, an input record field, an array, an array element, or a
table.
- A data area cannot be the subfield of a multiple occurrence data
structure, a data-area data structure, a program-status data structure, a
file-information data structure (INFDS), or a data structure that appears on
an *NAMVAR DEFN statement.
A data structure defined with a U in position 18 of the
input specifications form indicates that the data structure is a data
area. The data area is automatically read and locked at program
initialization time, and the contents of the data structure are written to the
data area when the program ends with LR on.
Specify *LDA in factor 2 of a *NAMVAR DEFN statement to define the LDA data
structure.
Use the *NAMVAR DEFN operation with *PDA in factor 2 to define the name in
the result field as the PDA data area. The result field follows the
current conventions for *NAMVAR DEFN.
[ Top of Page | Previous Page | Next Page | Table of Contents ]
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.