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]
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]
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)
DB-STORE REC recordname [FROM dataarea] ... [SYSID systemname] [DDN ddname]
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'