Hello All,
How to randomly access the vsam file using partial key? I don't have much hands on with VSAM, can someone please help?
How to randomly access the vsam file using partial key?
- Robert Sample
- Global Moderator
- Posts: 1895
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: How to randomly access the vsam file using partial key?
If you are accessing the VSAM KSDS data set (it is NOT a file) via the primary key, then you cannot use a partial key. However, as long as the partial key is the start of the key in COBOL you can use START to browse. If the partial key is not at the start of the key, then you must read the entire data set sequentially and compare the piece of the key you have against the record (or define an alternate key on those bytes of the primary key).
If you are accessing via an alternate index then you can use a partial key as long as the partial key is the start of the key.
If you are accessing via an alternate index then you can use a partial key as long as the partial key is the start of the key.
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute