FIND/GET WITHIN index SET retrieves records using the name of an index set and the index-sort-key fields specified in the WHERE clause.
Access mode: The syntax below is invalid when the access switch is set to IDMS.
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 ─┘ │ ├─ LASt ─┬────────────────┬───┤ │ └─ record-count ─┘ │ ├─ NEXt ◄ ─┬────────────────┬─┤ │ └─ record-count ─┘ │ ├─ PRIor ─┬────────────────┬──┤ │ └─ record-count ─┘ │ └─ ALL ───────────────────────┘ ►─┬─────────────────────────────────────────────────┬─ records ──────────────► └─┬────────────┬─ record-name ─┬────────────────┬─┘ └─ view-id. ─┘ └─ (field-list) ─┘ ►─┬─────────────────────────────┬────────────────────────────────────────────► └─ withIN index-set-name set ─┘ ►─┬───────────────────────────────────────────┬──────────────────────────────►◄ └─ WHEre index-criteria ─┬────────────────┬─┘ └─ AND criteria ─┘ ►►─── REPeat with ─┬────────────────────────────┬─────────────────────────────► ├─ FIRst ─┬────────────────┬─┤ │ └─ record-count ─┘ │ ├─ LASt ─┬────────────────┬──┤ │ └─ record-count ─┘ │ ├─ NEXt ─┬────────────────┬──┤ │ └─ record-count ─┘ │ ├─ PRIor ─┬────────────────┬─┤ │ └─ record-count ─┘ │ └─ ALL ──────────────────────┘ ►─┬─────────────────────────────────────────────────┬─ records ──────────────► └─┬────────────┬─ record-name ─┬────────────────┬─┘ └─ view-id. ─┘ └─ (field-list) ─┘ ►─┬───────────────────────────────────────────┬──────────────────────────────►◄ └─ WHEre index-criteria ─┬────────────────┬─┘ └─ AND criteria ─┘
Parameters:
Retrieves the first n (where n defaults to 1) records at the beginning of the current occurrence of the set type.
Retrieves the last n (where n defaults to 1) records at the end of the current occurrence of the set type.
Retrieves the next n (where n defaults to 1) records, starting with the record that follows the current record in the current occurrence of the set.
Retrieves the prior n (where n defaults to 1) records starting with the record that precedes the current record in the current occurrence of the set.
Retrieves all member records in the current occurrence of the set type.
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 indexed record to be retrieved. If the WITHIN SET clause does not specify the index-set name, use record-name. Record-name must be a record in an index set. If you have a WHERE clause, specify record-name. If a database record name is the same as a CA OLQ keyword, the name should be enclosed in quotation marks.
Specifies the name of the index set used for retrieval. If record-name is not specified or if record-name participates in more than one index set, this parameter is required.
Specifies comparison expressions based on the index field or its subfields. The criteria is evaluated for each entry in the index; a record is retrieved only when an index satisfies the conditions specified in this parameter.
Specifies criteria to be used by CA OLQ when selecting a record occurrence.
Duplicates an immediately preceding FIND/GET WITHIN index SET (or REPEAT for FIND/GET WITHIN index SET) command.
Retrieves the first n (where n defaults to 1) records at the beginning of the current set.
Retrieves the last n (where n defaults to 1) records at the end of the current set.
Retrieves the next n (where n defaults to 1) records starting with the record that follows the current record in the current set.
Retrieves the prior n (where n defaults to 1) records starting with the record that precedes the current record in the current set.
Retrieves all member records in the current set.
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 indexed record to be retrieved. Use this parameter if the WITHIN SET clause does not specify the index-set name. Record-name must be a record in an index set. If you specify a WHERE clause, also specify record-name. Enclose the database record name in quotation marks if it is the same as a CA OLQ keyword.
Specifies comparison expressions based on the index field or its subfields. The criteria is evaluated for each entry in the index; a record is retrieved only when an index satisfies the conditions specified in this parameter.
The rules for index-criteria are the same as for the WHERE clause criteria parameter.
Specifies criteria used in selecting a record occurrence.
If the selection criteria are changed and index-set retrieval is preferred, specify the record name in the REPEAT command.
Examples:
The following examples illustrate the use of the GET WITHIN index SET command and associated REPEAT commands based on the set occurrence diagram shown below:

Get First
A GET command retrieves the first SKILL record in the SKILL-NAME-NDX index set:
get first skill (skill-id-0455 skill-name-0455 skill-dbkey)
record in skill-name-ndx set
SKILL
SKILL-DBKEY : 0/5007106:1
SKILL-ID-0455 : 1030
SKILL-NAME-0455 : 'ACCT MGT '
END OF RECORD
Repeat
A REPEAT command retrieves the next SKILL record in the SKILL-NAME-NDX index set:
repeat with next
SKILL
SKILL-DBKEY : 0/5007107:1
SKILL-ID-0455 : 1040
SKILL-NAME-0455 : 'DEV MGT '
END OF RECORD
|
Copyright © 2013 CA.
All rights reserved.
|
|