RPG/400 Help


Data-Area Operations

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:

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 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 ]