View previous topic :: View next topic |
Author |
Message |
suma Beginner
Joined: 23 Jan 2006 Posts: 65 Topics: 29
|
Posted: Tue Apr 24, 2007 5:27 am Post subject: Partial key to read VSAM |
|
|
Hi all,
Is it possible to read the VSAM file using Partial key in Alterante key.
thanks
suma |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
suma Beginner
Joined: 23 Jan 2006 Posts: 65 Topics: 29
|
Posted: Tue Apr 24, 2007 7:24 am Post subject: |
|
|
Thanks Kolusu for your quick response...
I am using Random read for the VSAM file...I tried to use LoW-VALUES to the remaining fields for which I donno the values.
here is the key...
01 WS-ALT-KEY.
03 WS-A PIC X(9) VALUE SPACES.
03 WS-B PIC XX VALUE SPACES.
03 WS-C PIC X VALUE SPACES.
01 WS-VAR1 PIC X(9).
WS-ALT-KEY is the alternative key,here I know only WS-A of the key..i.e I am getting it from WS-VAR1 and remaining fields,am moving low-values..as show below
MOVE wS-VAR1 TO WS-A
MOVE LOW-VALUES TO WS-B
MOVE LOW-VALUES TO WS-C
when I tried to read the file using WS-ALT-KEY, read is find the record.
does anyone know, is there any other way of reading VSAM file using random access method with partially key.
Thanks
suma |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Tue Apr 24, 2007 9:08 am Post subject: |
|
|
Quote: |
when I tried to read the file using WS-ALT-KEY, read is find the record.
does anyone know, is there any other way of reading VSAM file using random access method with partially key.
|
suma,
I am not sure as to what your question is? did you have a problem reading? If so what is the filestatus code?
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
suma Beginner
Joined: 23 Jan 2006 Posts: 65 Topics: 29
|
Posted: Wed Apr 25, 2007 5:01 am Post subject: |
|
|
Kolusu,
sorry for confusion....
what I mean to say is,the VSAM random read is not finding the desired record with partial key WS-ALT-KEY.
the WS-ALT-KEY is alternative key, I know value upto 9 chars and remaining byte will have low values.
Thanks
Suma |
|
Back to top |
|
|
Sreejith Intermediate
Joined: 02 Dec 2002 Posts: 155 Topics: 25 Location: N.Ireland
|
Posted: Wed Apr 25, 2007 6:22 am Post subject: |
|
|
As Kolusu mentioned in the other post, you need to first
do a START with Key greater than or Equal to and then do a READ NEXT and then check the key returned matching your partial key |
|
Back to top |
|
|
|
|