On 24 Apr 2009 05:16:31 -0700, in bit.listserv.ibm-main you wrote:

>> -----Original Message-----
>> From: IBM Mainframe Discussion List On Behalf Of John McKown
>> 
>> [ snip ]
>> . . .. Take a case in point. A programmer has two VSAM KSDS
>> files. He is reading one file sequentially and wants to see in the
>second
>> file has as associated record in it (both files are keyed
>identically). How
>> to do that? I will grant that in the past, this was a "no brainer".
>However,
>> this "normal" (perhaps sub-normal?) programmer did it the "easy" way.
>He
>> read the first file sequentially. Then, for each record read, he did a
>keyed
>> read of the second file. The second file contained about 5% of the
>number of
>> records in the first file. So 95% of the time, the keyed read got a
>"record
>> not found" and, as a plus, ended up with its buffers flushed and
>positioning
>> lost.
>> 
>> Of course the correct way to do this is to read each file sequentially
>in
>> parallel (they are in the same order due to using the "same" key
>values),
>> doing a "match merge" type operation. But that mindset seems, at least
>> around here, to have disappeared. I did the "match merge" code to show
>how
>> to do it (with a dramatic reduction in CPU and elapsed time). The
>programmer
>> considered __that__ to be "too advanced" and "obscure".
>
>IBM already provides a program to do exactly that:  ICETOOL.
>
>Syncsort provides a similar program.  Don't know about CA-Sort.
>
>Why bother to reinvent that wheel?

I would have to know more about the nature of the data and whether
BLSR was used for the file with the keyed read.  How many records
would have been read using the sequential read?  Would all records on
the second file match records on the first file?  While I tend to
agree with reading the second file sequentially, that might not have
been the best solution.
>
>    -jc-
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to