ACCEPT
The ACCEPT statement has two variants:
Format 1 of ACCEPT determines the database key value of the CRR, CRS, CRA or CRU and places it in a COBOL item of type USAGE IS DATABASE-KEY. This item must be adapted (USAGE IS DATABASE-KEY-LONG) if it is not possible to guarantee that the database key values of the CRR, CRS, CRA or CRU lies in the extended value range.
If the determined database key value is too large for the result field, UDS/SQL reports status code 15102.Format 2 of ACCEPT determines the realm containing the record whose database key value is specified in the COBOL item of type USAGE IS DATABASE-KEY. This item must be adapted
(USAGE IS DATABASE KEY LONG) if database key values from the extended value range are to be passed in it.
FIND (format 1) and FETCH (format 1)
Format 1 of the FIND and FETCH statements locate a database record via the value of a COBOL item of type USAGE IS DATABASE-KEY. This item must be adapted (USAGE IS DATABASE-KEY-LONG) if a record whose database key value lies in the extended value range is to be found.
FIND (format 7) and FETCH (format 7)
Format 7 of FIND/FETCH can be used by the application program to select the desired set occurrence via the database key of the owner record if the Schema DDL contains the following two clauses:
LOCATION MODE IS DIRECT or LOCATION MODE IS DIRECT-LONG in the record entry of the owner record type
SET OCCURRENCE SELECTION THRU LOCATION MODE OF OWNER in the corresponding set entry
In order to select the set occurrence, the application program passes the database key value to the database key item named in the LOCATION MODE clause (see the "Design and Definition" manual).
In the case of LOCATION MODE IS DIRECT-LONG, the type of the associated database key item is DATABASE-KEY-LONG. In order to enable the application program to pass database key values of the extended value range, the type of the COBOL item that passes the database key value must be changed to USAGE IS DATABASE-KEY-LONG.
MODIFY
MODIFY can be used by the application program to move the Current Record of Run-unit (CRU) to another set occurrence if the Schema DDL contains the following two clauses:
LOCATION MODE IS DIRECT or LOCATION MODE IS DIRECT-LONG in the record entry of the owner record type and
SET OCCURRENCE SELECTION THRU LOCATION MODE OF OWNER in the corresponding set entry
The application program can select the desired set occurrence with MODIFY via the database key value of the owner record by passing the database key value to the database key item named in the LOCATION MODE clause (see the "Design and Definition" manual).
In the case of LOCATION MODE IS DIRECT-LONG, the type of the associated database key item is DATABASE-KEY-LONG. In order to enable the application program to pass database key values of the extended value range, the type of the COBOL item that passes the database key value must be changed to USAGE IS DATABASE-KEY-LONG.
SET
The SET statement transfers the contents of a database key item to one or more other database key items.
The target items must be adapted to the extended value range (USAGE IS DATABASE-KEY-LONG) if the following applies:
The item whose contents are to be transferred has already been changed to the type USAGE IS DATABASE-KEY-LONG or is a redefinition of an item of type USAGE IS DATABASE-KEY-LONG.
Database key values of the extended value range are to be transferred.
The behavior of the COBOL runtime system when assigning database key values with the SET statement is reflected in the table below (see the “Application Programming” manual):
Transfer to | DATABASE-KEY | DATABASE-KEY-LONG |
DATABASE-KEY | a | b |
DATABASE-KEY-LONG | c | a |
The values are mapped on a 1:1 basis
The values are extended internally
The values are internally truncated. If the database key value to be transferred is too large for a target item (REC-REF > 254 and/or RSQ > 224-1), a status code of 00102 is reported, and the value of the target item is set to 0; however, the execution of the statement is not aborted.
STORE
The STORE statement adds a new record to the database. If the schema entry for the record type involved contains the LOCATION MODE IS DIRECT or LOCATION MODE IS DIRECT-LONG clause, the database key value for the record to be stored can be specified by the application program. This is done by passing the database key value to the database key item named in the LOCATION MODE clause.
UDS/SQL then proceeds as described below:
Database key assignment:
UDS/SQL stores the record in the database under the database key value provided by the application program.Set occurrence selection:
If the record type involved is a member of a set that is defined with
SET OCCURRENCE SELECTION THRU LOCATION MODE OF OWNER, UDS/SQL stores the record as a member record in the set occurrence of the owner record whose database key value matches the one provided by the application program.
In the case of LOCATION MODE IS DIRECT-LONG, the type of the associated database key item is DATABASE-KEY-LONG. In order to enable the application program to pass database key values of the extended value range, the type of the COBOL item that passes the value must be changed to USAGE IS DATABASE-KEY-LONG.