Data-Area Operations

The data-area operations are:

These operations are available in both the traditional syntax and free-form syntax.

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 or procedures.

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 UNLOCK operations:

A data structure defined with a U in position 23 of the definition specifications indicates that the data structure is a data area. You may specify the DTAARA keyword for a data area data structure, if specified you can use the IN, OUT and UNLOCK operation codes to specify further operations for the 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. If the data area for a data area data structure is not found, it will be created with an initial value of blanks. If the library list was searched for the data area, the new data area will be created in QTEMP.

To define the local data area (*LDA) you can do one of the following:

To define the *PDA you may specify the DTAARA(*PDA) keyword on the definition specification for the data area, or specify *PDA in factor 2 of a *DTAARA DEFINE statement.



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