To perform a direct read, code the following:
The start position of the VSAM record is relative to the beginning of the input buffer. The input buffer contains the entire key-file record followed by the VSAM record.
If an alternate input file is required, it can be assigned with the DD= option on the INPUT parameter.
To directly access specific records in the file, code the KEY control statement as shown below:
The code... |
Identifies... |
---|---|
F (default) |
Fixed-length records |
V |
Variable-length records |
U |
Undefined length records |
The code... |
Identifies a... |
---|---|
Blank (default) |
Sequential file (z/VSE) Tape file (z/VSE) |
4 |
Punched card (z/VSE) |
8 |
VSAM file (z/OS) |
The code... |
Identifies... |
---|---|
Blank (default) |
Standard labels |
S |
Standard labels |
N |
No labels |
A |
Standard labels User-defined labels |
The keyword... |
Identifies... |
---|---|
K |
KSDS |
A |
ESDS |
Notes
Example
This example retrieves selected records directly from a variable-length KSDS file.
The following code uses:
IN 162 V 80 UM(CULLVSAM) REC KEYFILE-KEY 1 4 3 REC NAME 81 16 REC BALANCE 97 6 2 DP=2 REC ACCOUNT 109 4 3 013EXAMPLE OF CULLVSAM 01410040 'DIRECT READ OF A VARIABLE LENGTH KEY-SEQUENCED FILE' 0142*001 ' ' 0151*001 NAME HH 'NAME' 0151*002 BALANCE HH 'BALANCE' 0151*003 ACCOUNT FN HH 'ACCOUNT' 0151*004 KEYFILE-KEY FN HH 'KEY FROM' 'KEYFILE' 017 IF NAME EQ '**' DROP 017 IF KEYFILE-KEY EQ ACCOUNT TAKE 017 DROP 01OUT D //CULPRIT.VSAMCTRL DD * KEY0080F001 K 000104
Copyright © 2014 CA.
All rights reserved.
|
|