Run the 4's then run the 5's. It can't be that simple.
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of
Frank Swarbrick
Sent: Tuesday, April 03, 2012 4:24 PM
To: [email protected]
Subject: VSAM help wanted for random reads
Current program does the following (in COBOL!).
- Opens KSDS for I-O
- Sequentially processes another file (non-VSAM).
- For each record in the non-VSAM file it attempts a random (keyed) read of a
record on the KSDS file. The key is, essentially, a concatenation of a record
type code ('4' or '5') and an account number. If no record of type '4' is
found then it tries again for the same account, but with record type '5'. If
either the '4' or '5' type is found it updates it and rewrites the record
(assuming the data changed).
This takes about 16 minutes to run. However if the 'type 5' logic is removed,
so that it only ever looks for type '4' records, it takes only about one minute.
Our resident VSAM expert says it has something to do with the VSAM "sequence
set" and the fact that only one is kept in memory at a time. Since the same
sequence set doesn't appear to be able to be used for both the 'type 4' records
and the 'type 5' records it's constantly going back and forth, loading the
"other" sequence set from disk. He says on VSE (which we were up until May
2010) more than one sequence set can be in memory, but with MVS this appears to
not be the case.
Hopefully that reason is accurate. Is there a solution? We thought about
having two COBOL FDs pointing to two DDs, where both DDs pointed to the same
KSDS. This would probably(?) work, except for the fact of the update.
Thanks,
Frank
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to
[email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN