DB-MODIFY ... REC|REF recordname1 [FROM dataarea] ... [VIEW|PCB pcbname] . . . ... REC|REF recordnameN [FROM dataarea] ... [VIEW|PCB pcbname]
REC recordname |
IMS segment to process. |
REF recordname |
Specify an IMS segment to reference. The program uses the referenced segment for navigating the database. |
FROM dataarea |
Alternate I/O area where program deletes, modifies, or adds a record. Code FROM when a record is obtained from an I/O area other than the default I/O area, such as by DB-OBTAIN INTO. |
PCB pcbname |
Specify the PCB used when the PSB contains multiple PCBs for the same database. Code PCB when a record is obtained from the default PCB. |
VIEW pcbname |
Specify the PCB used when the PSB contains multiple PCBs for the same database. Code VIEW when a record is not obtained from the default PCB. |
DB-OBTAIN REC RECORD-A WHERE KEY-A = VALUE-A ... REC RECORD-B WHERE KEY-B = VALUE-B ... REC RECORD-C WHERE KEY-C = VALUE-C HOLD DB-MODIFY REF RECORD-A ... REF RECORD-B ... REC RECORD-C
The following examples assume that the following DB-OBTAIN path call precedes the DB-MODIFY.
$DB-OBTAIN ("REC SEG1, REC SEG2, REC SEG3")
To modify all records retrieved in the path:
$DB-MODIFY ("REC SEG1, REC SEG2, REC SEG3")
To modify just SEG2:
$DB-MODIFY ("REF SEG1, REC SEG2")
To modify just SEG3:
$DB-MODIFY ("REF SEG1, REF SEG2, REC SEG3")
The following example assumes that the following DB-OBTAIN call precedes the DB-MODIFY. This DB-OBTAIN is not a path call and places only SEG3 into the I/O area; therefore, DB-MODIFY ignores SEG1 and SEG2:
$DB-OBTAIN ("REF SEG1, REF SEG2, REC SEG3")
To modify SEG3 only:
$DB-MODIFY ("REC SEG3")
The following examples assume that the following DB-OBTAIN path call precedes the DB-MODIFY. This DB-OBTAIN places only SEG2 and SEG3 into the I/O area; therefore, DB-MODIFY ignores SEG1:
$DB-OBTAIN ("REF SEG1, REC SEG2, REC SEG3")
To modify SEG3 only:
$DB-MODIFY ("REF SEG2, REC SEG3")
To modify SEG2 only:
$DB-MODIFY ("REC SEG2")
DB-MODIFY updates row contents in a table or cursor set as follows:
DB-MODIFY REC copylibname-REC ... [column1 [(altvalue)] [... columnN [(altvalue)]]] ... [FROM dataname] ... [WHERE column1 operator [:]altvalue . . . ... AND|OR columnN operator [:]altvalue] ... [END[WHERE]]] ... [WHERE CURRENT [OF] cursorname] ... [QUERYNO number] ... [WITH [CS|RS|RR]]
DB-MODIFY REC D2TAB-REC ... PM_UNIT_BASE_PRICE (25.99) ... PM_UNITS (:WS-UNITS) ... WHERE PM_PART_SHORT_DESC = 'WIDGET' ... AND PM_COLOR = 'RED' ... AND PM_UNIT_BASE_PRICE < 50
DB-MODIFY REC recordname [FROM dataarea]
Hold CUST-RECORD for modification; specify an alternate storage area to contain the data that updates the record.
DB-OBTAIN REC CUST-RECORD ... WHERE CUST-NUMBER = SCREEN-CUST-NUMBER IF OK-ON-REC DB-MODIFY REC CUST-RECORD ... FROM CUST-RECORD-UPDATE-AREA
DB-MODIFY REC recordname [FROM dataarea] ... [SYSID systemname] [DDN ddname]
DDN ddname |
Specify file ddname; can be a literal or data name defined as PIC X(8). Supply a value to the name option of CICS DATASET. |
FROM dataarea |
Alternate I/O area where program deletes, modifies, or adds a record. Required for a record obtained from an I/O area other than the default I/O area, such as by DB-OBTAIN INTO |
REC recordname |
COBOL record or IMS segment to process. |
SYSID systemname |
Remote system name (maximum 4 characters); can be a literal region name or a Working-Storage field. |
DB-OBTAIN REC CUST-RECORD ... WHERE CUST-NUMBER = SCREEN-CUST-NUMBER ... HOLD IF OK-ON-REC DB-MODIFY REC CUST-RECORD ... FROM CUST-RECORD-UPDATE-AREA