Previous Topic: Access Strategies

Next Topic: Types of OPSVSAM Functions

Output Variables

OPS/REXX variables are created for each VSAM operation. These variables indicate the result of the operation. The result returned from the function is null, except for the READ and READUP requests, which return the record that was read.

OPSRC

The VSAM operation return code (0/4/8/12, and so on). The code 78 is returned for dynamic allocation failures and abends.

OPSRE

The reason code indicated in the last byte of the RPL feedback area. For detailed information about the meaning of these codes, see the IBM VSAM macro reference guide.

OPSRC    OPSRE    Meaning
8          4      End of file on read
8         16      Record not found for keyed access
OPSKEY

The key of the last record that was read or written. Relative record numbers and relative byte addresses are stored as four-byte binary numbers. To convert to decimal number strings, use C2D(opskey).

OPSRBA

The RBA of the last record that was read or written in four-byte binary format.

The following variables are set only by the OPEN operation:

Variable

Definition

OPSDD

The ddname of the file. This variable can be used for the ddname argument of all subsequent operations.

OPSDSN

The data set name of the file.

OPSLRECL

The maximum record size.

OPSKEYLN

The KSDS full key length.

OPSKEYOF

The KSDS key offset relative to one. You can use this offset as the begin value in a REXX SUBSTR function to extract the key value from a returned record.