FIND/GET WITHIN DBKEYLIST retrieves records, based on the list of dbkeys collected during previous retrieval commands.
Access mode: The syntax below is invalid when the access switch is set to IDMS.
CA OLQ automatically stores the database key of each record as it is retrieved (when OPTION DBKEY is specified). When a path definition is executed, CA OLQ stores only database keys for record occurrences associated with the primary record type in the path. The resulting dbkey list provides the basis for GET WITHIN DBKEYLIST retrieval.
Use dbkey list retrieval to optimize retrieval of a large number of records using FIND. Issue GET WITHIN DBKEYLIST commands to specify progressively more restrictive selection criteria until your exact retrieval requirements are met. The optional WHERE clause is often associated with this command.
Note: The GET WITHIN DBKEYLIST command cannot be used to access Key Sequence Data Set (KSDS) VSAM files; database keys have no meaning for KSDS VSAM records.
FIND locates database records but does not retrieve them into the report file. GET locates database records and does retrieve them into the report file.
Syntax:
►►─┬─ FINd ─┬─┬────────────────────────────┬──────────────────────────────────► └─ GET ──┘ ├─ FIRst ─┬────────────────┬─┤ │ └─ record-count ─┘ │ └─ ALL ◄ ────────────────────┘ ►─┬─────────────────────────────────────────────────┬─ records ──────────────► └─┬────────────┬─ record-name ─┬────────────────┬─┘ └─ view-id. ─┘ └─ (field-list) ─┘ ►─── withIN DBKEYList ───────────────────────────────────────────────────────► ►─┬──────────────────┬───────────────────────────────────────────────────────►◄ └─ WHEre criteria ─┘ ►►─── REPeat with ─┬────────────────────────────┬─────────────────────────────► ├─ FIRst ─┬────────────────┬─┤ │ └─ record-count ─┘ │ └─ ALL ──────────────────────┘ ►─┬─────────────────────────────────────────────────┬─ records ──────────────► └─┬────────────┬─ record-name ─┬────────────────┬─┘ └─ view-id. ─┘ └─ (field-list) ─┘ ►─┬──────────────────┬───────────────────────────────────────────────────────►◄ └─ WHEre criteria ─┘
Parameters:
Retrieves the first n (where n defaults to 1) records in the database key list.
Retrieves all the records in the dbkey list.
The qualifying ID for the record or logical record name. Use view-id when you are signed on to multiple subschemas. View-id refers to the subschema where the record (or logical record) can be found.
The name of the record type last retrieved. Use record-name if you specify a field list. If a database record name is the same as a CA OLQ keyword, enclose the name in quotation marks.
Specifies retrieval of records directly, by means of the database key list (required).
Specifies criteria used in selecting a record occurrence.
REPEAT FIND/GET WITHIN DBKEYLIST duplicates an immediately preceding FIND/GET WITHIN DBKEYLIST (or REPEAT for FIND/GET WITHIN DBKEYLIST) command.
Retrieves the first n (where n defaults to 1) records in the database key list.
Retrieves all the records in the database key list.
The qualifying ID for the record or logical record name. Use view-id when you are signed on to multiple subschemas. View-id refers to the subschema where the record (or logical record) can be found.
The record type last retrieved. Use record-name if specifying a field list. Enclose the database record in quotation marks if it is the same as a CA OLQ keyword.
Specifies criteria used in selecting a record occurrence.
Examples:
The following examples illustrate the use of FIND/GET WITHIN DBKEYLIST and associated REPEAT commands, based on the set occurrence diagram shown below:

Find
FIND retrieves 56 EMPLOYEE records from the database:
option dbkey ! find all sequential employee records OLQ 098006 00 57 whole lines and 0 partial lines in report. OLQ 098007 00 57 records read. 57 records selected.
Get Within Dbkeylist
A GET WITHIN DBKEYLIST command retrieves all the EMPLOYEE records in which the EMP-CITY-0415 field value is WESTWOOD:
get all within dbkeylist where emp-city-0415 is westwood OLQ 098006 00 3 whole lines and 0 partial lines in report. OLQ 098007 00 50 records read. 3 records selected.
Repeat Within Dbkeylist
A REPEAT WITHIN DBKEYLIST selects all the EMPLOYEE records in which the EMP-CITY-0415 field value is ARLINGTON:
repeat with all where emp-city-0415 is arlington OLQ 098006 00 3 whole lines and 0 partial lines in report. OLQ 098007 00 50 records read. 3 records selected.
|
Copyright © 2013 CA.
All rights reserved.
|
|