Discussion:
[hercules-os380] Generic Queries with MVS3.8j VSAM
meriwether.wayne@yahoo.com [hercules-os380]
2018-08-09 18:47:54 UTC
Permalink
I am using the MVS 3.8j in TK4- and would like to read a VSAM key-sequenced dataset using a partial key or generic key, e.g., 'MERIW*' . Does that version of VSAM permit a partial key read? Could someone point me to an example of assembler code to do that kind of read?

Thanks so much for your help.
Wayne Meriwether
Mike Schwab Mike.A.Schwab@gmail.com [hercules-os380]
2018-08-10 16:45:06 UTC
Permalink
http://www.edwardbosworth.com/My3121Textbook_HTM/MyText3121_Ch28_V01.htm

Open
next key: point
Next record: get
Repeat next record until key is too high
Repeat next key until done.
Close
Post by ***@yahoo.com [hercules-os380]
I am using the MVS 3.8j in TK4- and would like to read a VSAM
key-sequenced dataset using a partial key or generic key, e.g., 'MERIW*' ..
Does that version of VSAM permit a partial key read? Could someone point
me to an example of assembler code to do that kind of read?
Thanks so much for your help.
Wayne Meriwether
--
Mike A Schwab, Springfield IL USA
Where do Forest Rangers go to get away from it all?
Joe Monk joemonk64@gmail.com [hercules-os380]
2018-08-11 11:51:25 UTC
Permalink
Its not quite that simple. You have to build an alternate index and the
read by the alternate index. This is so because there could be multiple
MERIW* records.

So, you use POINT to position to the first MERIW* record shown by the
alternate index. Then you use a read next loop, reading down the alternate
index until you find the one you want. Then you can use POINT to get the
record by primary key, with the HOLD if you want to update it.

Primary Keys cannot have duplicate values, alternate keys can.

Joe
Post by Mike Schwab ***@gmail.com [hercules-os380]
http://www.edwardbosworth.com/My3121Textbook_HTM/MyText3121_Ch28_V01.htm
Open
next key: point
Next record: get
Repeat next record until key is too high
Repeat next key until done.
Close
Post by ***@yahoo.com [hercules-os380]
I am using the MVS 3.8j in TK4- and would like to read a VSAM
key-sequenced dataset using a partial key or generic key, e.g., 'MERIW*' .
Does that version of VSAM permit a partial key read? Could someone point
me to an example of assembler code to do that kind of read?
Thanks so much for your help.
Wayne Meriwether
--
Mike A Schwab, Springfield IL USA
Where do Forest Rangers go to get away from it all?
Gerhard Postpischil gerhardp@charter.net [hercules-os380]
2018-08-10 20:58:30 UTC
Permalink
Post by ***@yahoo.com [hercules-os380]
I am using the MVS 3.8j in TK4- and would like to read a VSAM
key-sequenced dataset using a partial key or generic key, e.g., 'MERIW*'
.  Does that version of VSAM permit a partial key read?  Could someone
point me to an example of assembler code to do that kind of read?
Not only does it work, but I used it backwards. We had a key that
increased over time, but normally wanted to retrieve the most current
record. We wrote the records with the complement of the key, so the
generic retrieval returned the current record.

Gerhard Postpischil
Bradford, VT

---
This email has been checked for viruses by AVG.
https://www.avg.com
Loading...