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]]
REC copylib-REC |
Specify the 01-level name of the COBOL row layout in the DCLGEN or copybook information. Cannot be the same as any cursor names or DB-PROCESS-ID names. |
|
column1 [(altvalue)] |
Altvalue can be a literal, column name, host variable, or one of the following expressions:
If you name an alternate host variable for a specific column, do not code FROM, which names an entire alternate host structure. See also the information on Host variables in the General Rules section of the Help topic Database Calls. |
|
FROM dataname |
Move alternate data structure to the host variable structure name. Data moves prior to the actual SQL call via MOVE statement. |
|
WHERE column operator |
Not valid for cursor processing. Column is the column on which to qualify the selection. Operator can be =, ^=, >, <, >=, <=, native SQL predicates (such as LIKE and BETWEEN). |
|
[:]altvalue |
Alternate value; when used with WHERE, AND , or OR, it can be a literal or a column name. |
|
END[WHERE] |
Terminate a WHERE clause. Required if you code WHERE before FROM. |
|
WHERE CURRENT [OF] cursorname |
Valid for cursor processing only. Act upon the row retrieved from cursorname. |
|
QUERYNO number |
Specifies the number to be used for this SQL statement in EXPLAIN output and trace records. |
|
WITH |
Specifies the isolation level at which the statement is executed. |
|
CS |
Cursor stability |
|
RS |
Read stability |
|
RR |
Repeatable read |
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]
REC recordname |
COBOL record to process. |
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 |
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