

Accessing Auxiliary Storage: FILE › VSAM Files › FILE Functions for VSAM Records › Example
Example
To view the record with the key 'REC001' and the next record, and then to terminate the browse, follow these steps:
- Specify the following (or press PF4):
FUNC= BEGB
RCID= C`REC001'
Press Enter to display the record with a key of REC001.
- Press Enter to display the next record.
- Press PF4 to end the browse.
Search for a Data String
To search for a data string, specify the BROWSE operation on the FILE definition.
- Specify the following required information:
FUNC= SRCH
RCID= id of record where search should begin
DATA= data string to be located
LOC a number or the keyword ANY
If a number is entered in the LOC field, FILE looks for the data string only at the specified location. If ANY is entered, FILE searches the entire record for the specified data string.
- To search more than one record, enter the number of records that you want to search in the SIZE field.
- Specify the following optional information for a KSDS file:
SRCHTYP= FKGE/FKEQ/GKEQ/GKGE
- If you specify SRCHTYP=FKGE, enter the full key in the RCID field. The search starts with the specified record or the record with the next higher key. This is the default.
- If you specify SRCHTYP=FKEQ, enter the full key in the RCID field. The search starts with the specified record.
- If you specify SRCHTYP=GKEQ, enter a generic (partial) key in the RCID field. The search starts with the first record whose key matches the generic key.
- If you specify SRCHTYP=GKGE, enter a generic (partial) key in the RCID field. The search starts with the first record whose key matches the generic key or the next higher key.
- Press Enter. If FILE finds the requested data string, it displays the record in which it is found, starting with the requested string. The RETNRCID field displays the ID of the record and the LOC field displays the record position at which the data was found.
If the data is not found, the message DATA NOT FOUND opens.
Copyright © 2014 CA Technologies.
All rights reserved.
 
|
|