DB-STORE [REC|REF recordname1] [FROM dataarea] ... [VIEW|PCB pcbname] ... [WHERE fieldname operator value] ... [REC|REF recordname2] [FROM dataarea] ... [VIEW|PCB pcbname] ... [WHERE fieldname operator value] ... [SUB number] [OF|IN dataarea] . . . ... REC recordnameN [FROM dataarea] ... [VIEW pcbname|PCB pcbname] ... [WHERE fieldname operator value] ... [SUB number] [OF dataarea]
REC|REF recordname |
IMS segment 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. |
VIEW|PCB pcbname |
Synonymous with VIEW. Specify the PCB used when the PSB contains multiple PCBs for the same database. |
WHERE keyname operator value |
Operator can be =, EQ, >, GT, <, LT, >=, GE, <=, LE, <>, NE, ^=. Value can be literal, data name, or an asterisk (*). An asterisk indicates the segment record description contains the key value. |
SUB[SCRIPT] (value) |
Move the subscripted field value to a specified field. Value can be a data name, literal, or, under VSAM Batch or Online, an integer. |
OF|IN dataarea |
Qualify the I/O area moving to the value field, when more than one structure in the Data Division contains the field. |
Add an occurrence of RECORD-A to the database.
DB-STORE REC RECORD-A
Add one occurrence of RECORD-A and one of its dependents, RECORD-B.
DB-STORE REC RECORD-A REC RECORD-B
Add one occurrence of RECORD-B, a dependent of a specific RECORD-A.
DB-STORE REF RECORD-A WHERE FIELD-1 = VALUE-1 ... REC RECORD-B
Alternately, add RECORD-B by coding DB-STORE after DB-OBTAIN.
DB-OBTAIN REF RECORD-A WHERE KEY-A = VALUE-A DB-STORE RECORD-B
DB-STORE enables you to add entire rows or selected columns.
DB-STORE REC copylibname-REC ... [column1 [(altvalue)] [... columnN [(altvalue)]]] ... [FOR number ROWS] [NOT ATOMIC] ... [FROM dataname] ... [QUERYNO number] ... [WITH [CS|RS|RR]]
DB-STORE REC copylibname-REC ... [column1 [(altvalue)] [... columnN [(altvalue)]]] ... [DB-OBTAIN REC copylibname-REC ... column1 [... columnN] ... [FOR number ROWS] [NOT ATOMIC] ... WHERE column1 operator [:]altvalue ... [AND|OR column2 operator [:]altvalue]] . . ... [AND|OR columnN operator [:]altvalue] ] ... [QUERYNO number] ... [WITH [CS|RS|RR]
DB-STORE REC copylibname-REC OVERRIDE ... [column1 [(altvalue)] [... columnN [(altvalue)]]]
REC copylibname-REC |
Specify the 01-level name of the COBOL row layout in the DCLGEN or copybook information. Copybook library name of source data. 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:
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. |
|
FOR number ROWS |
Controls how many rows are returned. |
|
NOT ATOMIC |
Rows should not be inserted as an atomic operation. Note: Do not code ATOMIC, which is the default and should not be coded.
|
|
WHERE column operator |
Column is the column on which to qualify the selection. Operator can be =, ^=, >, <, >=, <=, native SQL predicates (such as LIKE and BETWEEN). |
|
[:]altvalue |
Altvalue can be a literal or a data name. |
|
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 |
|
OVERRIDE [13] |
Issue a DB-STORE command where:
|
Insert specific columns into D2MASTER; for PM_PART_NO, store information from the default COBOL host variable; for other columns, name alternate sources of information.
DB-STORE REC D2TAB-REC ... PM_PART_NO PM_NEW_PART_NO ('23432') ... PM_COLOR (:WS-NEW-COLOR)
Insert columns IN_PART_NO and IN_UNIT_BASE_PRICE from D2MASTER into table D2INVEN; select only rows from D2MASTER where PM_PART_NO does not equal PM_NEW_PART_NO.
DB-STORE REC D2INVEN-REC ... IN_PART_NO IN_UNIT_BASE_PRICE ... DB_OBTAIN REC D2MASTER-REC ... PM_PART_NO PM_UNIT_BASE_PRICE ... WHERE PM_PART_NO not= PM_NEW_PART_NO
Use SQL insert with expressions and with the DEFAULT keyword.
DB-STORE ... REC EMSAVING-REC ... ACCOUNT_NUMBER ('100') ... CUSTOMER_NAME ('MILLER') ... ADDRESS_1 ('101 FIRST STREET') ... ACCOUNT_TYPE (DEFAULT) ... CITY ('JEFFERSON') ... STATE ('NY') ... ZIP_CODE ('19801') ... PREVIOUS_BALANCE (1000 + 22) ... DEPOSITS (1000 / 21.6) ... WITHDRAWALS (1000 / 22.5) ... INTEREST_PAID (1000 - 22) ... CURRENT_BALANCE (WS-CUR-BALANCE * 22)
Insert MY_COLUMNn, overriding the name with the text in parentheses that follows.[13]
DB-STORE REC MYTABLE-REC OVERRIDE ... MY_COLUMN3 (DEFAULT) ... MY_COLUMN4 (45)
DB-STORE REC recordname [FROM dataarea]
REC|REF 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. |
Write ORDR-RECORD to the file; check file status.
DB-STORE REC ORDR-RECORD IF OK-ON-REC SCREEN-MSG = 'ORDER ADDED TO FILE' ELSE-IF IVD-ON-REC SCREEN-MSG = 'ORDER ALREADY EXISTS'
DB-STORE REC recordname [FROM dataarea] ... [SYSID systemname] [DDN ddname]
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. |
SYSID systemname |
Remote system name (maximum 4 characters); can be a literal region name or a Working-Storage field. |
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. |
Write ORDR-RECORD to the file; check file status.
DB-STORE REC ORDR-RECORD IF OK-ON-REC SCREEN-MSG = 'ORDER ADDED TO FILE' ELSE-IF IVD-ON-REC SCREEN-MSG = 'ORDER ALREADY EXISTS'