One (of many) possible explanations is that there are more hits on the type 5 and more rewrites. Depending on your VSAM options, a rewrite can be -very- expensive.
Try a comparison run without the type 4 logic. Also try BLSR and DISP=OLD. That makes the best use of VSAM buffering. -----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 NOTICE: This electronic mail message and any files transmitted with it are intended exclusively for the individual or entity to which it is addressed. The message, together with any attachment, may contain confidential and/or privileged information. Any unauthorized review, use, printing, saving, copying, disclosure or distribution is strictly prohibited. If you have received this message in error, please immediately advise the sender by reply email and delete all copies. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN

