MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Partial key to read VSAM

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
suma
Beginner


Joined: 23 Jan 2006
Posts: 65
Topics: 29

PostPosted: Tue Apr 24, 2007 5:27 am    Post subject: Partial key to read VSAM Reply with quote

Hi all,

Is it possible to read the VSAM file using Partial key in Alterante key.



thanks
suma
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue Apr 24, 2007 5:30 am    Post subject: Reply with quote

suma,

SEARCH before posting. check this link

http://www.mvsforums.com/helpboards/viewtopic.php?t=2967&highlight=partial

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
suma
Beginner


Joined: 23 Jan 2006
Posts: 65
Topics: 29

PostPosted: Tue Apr 24, 2007 7:24 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue Apr 24, 2007 9:08 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
suma
Beginner


Joined: 23 Jan 2006
Posts: 65
Topics: 29

PostPosted: Wed Apr 25, 2007 5:01 am    Post subject: Reply with quote

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
View user's profile Send private message
Sreejith
Intermediate


Joined: 02 Dec 2002
Posts: 155
Topics: 25
Location: N.Ireland

PostPosted: Wed Apr 25, 2007 6:22 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group