Previous Topic: FREE STORAGE (DC/UCF)Next Topic: GET QUEUE (DC/UCF)


GET

The GET statement transfers the contents of a specified record occurrence from the record buffer into program variable storage. Elements in the specified record are moved to their respective locations in variable storage according to the subschema view of the record. The transferred elements will appear in storage at the location to which the record has been bound (for further details, see BIND RECORD earlier in this chapter).

Currency

The GET statement operates only on the record that is current of run unit. Following successful execution of a GET statement, the accessed record is current of run unit, its record type, its area, and all sets in which it participates as member or owner.

Syntax
►►─── GET ─┬────────────────────────┬─ ; ─────────────────────────────────────►◄
           └─ RECORD (record-name) ─┘

Parameter

RECORD (record-name)

Optionally specifies the record type of the current of run unit. If this optional clause is used, the current of run unit must be an occurrence of the named record type.

Example

The following statement moves the record that is current of run unit (in this case, the OFFICE record) from the record buffer into program variable storage:

GET RECORD (OFFICE);
Status Codes

Upon completion of the GET function, the ERROR_STATUS field in the IDMS DB communications block indicates the outcome of the operation:

0000

The request has been serviced successfully.

0506

Currency has not been established.

0508

The named record is not in the subschema. The program has probably invoked the wrong subschema.

0510

The subschema specifies an access restriction that prohibits retrieval of the named record.

0513

A current record of run unit either has not been established or has been nullified by a previous ERASE statement.

0518

The record has not been bound.

0520

The current record is not the same type as the named record.

0526

The requested record has been erased.

0555

An invalid length has been returned for a variable-length record.