Technical data

MODIFY
2. The DBCS changes the contents of the entire database record:
If you specify record-name
If you specify neither record-name nor record-item
3. Using record-item limits the changes to the database record to only those
items you specify.
4. If you modify any data item that is the sort key for that record’s position in
a sorted set, the DBCS automatically repositions the record in that set in
accordance with the set-ordering criteria of the set type.
If the value of the sort key is identical to another record of this type, and if
duplicates are not allowed for this sorted set, the DBCS does not perform the
MODIFY operation, and a database exception condition occurs.
5. Currency indicator update rules for record insertion and removal are as
follows:
If the MODIFY statement removes a record from the current set, the
currency indicator for that set points to the position in the set vacated by
the record. (At this position the record is no longer accessible.)
If the MODIFY statement reinserts a record in a set in another location,
the set currency indicator changes to point to the record in this new
location.
If you do not include the RETAINING clause (see Section 4.9.1,
RETAINING Clause), the currency indicator for the set is modified to
the current record of the run unit.
6. The current record of the run unit must be in a realm in ready update mode
and all records required by the DBCS to execute the MODIFY statement
must be in realms in one of the appropriate READY modes.
7. The contents of the user work area (UWA) do not change after the successful
or unsuccessful execution of a MODIFY statement.
8. If the execution of a MODIFY statement results in an exception condition, the
record is not changed.
9. If a database exception condition occurs during the execution of a MODIFY
statement, the DBCS places a database exception condition code in the
special register DB-CONDITION (see Technical Notes). This code identifies
the condition.
Technical Notes
MODIFY statement execution can result in these DB-CONDITION database
exception condition codes:
DBM$_CRUN_NULL The currency indicator for the run unit is null.
DBM$_CRUN_POS The currency indicator for the run unit specifies the
position of a vacated record in a record collection.
DBM$_WRONGRTYP The record type of record-name is not the same type as
the current record of the run unit, or the record-item
is not a group or elementary item of the current record
type.
4–46 Procedure Division