GET (COBOL)
The GET statement transfers the contents of a specified record occurrence from the record buffer to 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 appear in storage at the location to which the record has been bound. (For further details, see .)
idmscu
The GET statement transfers the contents of a specified record occurrence from the record buffer to 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 appear in storage at the location to which the record has been bound. (For further details, see BIND RECORD (COBOL).)
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-name─┘
Parameters
- GETrecord-nameSpecifies that 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 OFFICE.
Status Codes
After completion of the GET function, the ERROR-STATUS field in the IDMS communications block indicates the outcome:
Status code
| Meaning
|
0000 | The request has been serviced successfully. |
0503 | Invalid currency for a record to be retrieved on a GET. This code occurs only when a run unit is sharing a transaction with other database sessions. The 03 minor status is returned when the run unit tries to get a record using a currency that has been invalidated because of changes that were made by another database session that is sharing the same transaction. |
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 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. |