The MODIFY RECORD statement replaces element values of the specified record occurrence in the database with new element values defined in program variable storage.
Steps Before Using MODIFY RECORD
Before executing the MODIFY RECORD statement, satisfy the following conditions:
Modifying CALC- and Sort-Control Elements
The following special considerations apply to modification of CALC- and sort-control elements:
Considerations for Native VSAM Users
The following special considerations apply to the modification of records in native VSAM datasets:
Currency
The specified record must be established as current of run unit.
Following successful execution of the MODIFY RECORD statement, the modified record becomes the current record of run unit, its record type, its area, and all sets in which it participates as member or owner.
►►─── MODIFY RECORD (record-name); ───────────────────────────────────────────►◄
Parameter
Defines the named record occurrence, as specified in program variable storage. Record-name must specify a record type included in the subschema.
The following Example illustrates the steps involved in modifying an occurrence of the EMPLOYEE record. Assume that the employee address is to be changed.
EMP_ID_0415 = EMP_ID_IN; OBTAIN CALC RECORD (EMPLOYEE);
EMP_ADDRESS_0415 = NEW_ADDRESS;
MODIFY RECORD (EMPLOYEE);
Upon completion of the MODIFY RECORD function, the ERROR_STATUS field in the IDMS DB communications block indicates the outcome of the operation:
The request has been serviced successfully.
The OCCURS DEPENDING ON item is less than 0 or greater than the maximum number of occurrences of the control element.
Modification of the record would violate a duplicates-not-allowed option for a CALC record, a sorted set, or an index set.
Currency has not been established for the named record.
The specified record cannot be found. The record name has probably been misspelled.
The named record's area has not been readied in one of the update usage modes.
The subschema specifies an access restriction that prohibits modification of the named record.
There is insufficient space to hold the modified variable-length record occurrence.
A current record of run unit has not been established or has been nullified by a previous ERASE statement.
The record has not been bound.
The current record of run unit is not the same type as the named record.
An area other than the area of the named record has been readied with an incorrect usage mode.
No current record of set type has been established.
At least one sorted set in which the named record participates has not been included in the subschema.
An invalid length has been defined for a variable length record.
A record occurrence has been encountered whose type is inconsistent with the set named in the ERROR_SET field of the IDMS DB communications block; probable causes include: a broken chain and improper database description.
Either the length of a record in a native VSAM ESDS has been changed or a prime key in a native VSAM KSDS has been modified.
|
Copyright © 2014 CA.
All rights reserved.
|
|