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 

Coding for VSAM Alternate Index

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


Joined: 03 Aug 2004
Posts: 2
Topics: 1

PostPosted: Tue Aug 03, 2004 7:43 pm    Post subject: Coding for VSAM Alternate Index Reply with quote

I need some help trying to tie everything together to access a VSAM file in COBOL and Easytrieve using an Alternate Key.

I have an IDCAMS with Delete, Define Cluster, Define AlternateIndex, and Define Path commands. I have UPDATE or UPGRADE specified in my AltIndex and Path commands, so I don't think I need a BLDINDEX. I get an RC 0 from each step when I execute it.

But I don't know how to code this in either COBOL or EASYTRIEVE so that I can access the alternate key rather than the primary. Also, in the JCL, do I put the cluster name in the DSN, or does the path name go there instead?
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 Aug 03, 2004 9:34 pm    Post subject: Reply with quote

Tomkatt,

Check this link which explains in detail about processing alternate index in cobol

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3PG10/1.10.6.2?DT=20020923143836#HDRWQ354

Hope this helps...

Cheers

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


Joined: 15 May 2004
Posts: 17
Topics: 2
Location: Mumbai , India

PostPosted: Tue Aug 03, 2004 11:58 pm    Post subject: Reply with quote

Quote:
so I don't think I need a BLDINDEX
--- then how are u going to have the alternate index??? Also pls remember to load the base cluster first before doing a BLDINDEX.

In JCL u need to give :

//ddvsam dd dsn=base cluster
//ddvsam1 dd dsn=path name

Now I have a question of my own ... let's consider the above example. ddvsam1 specifies the pathname for the first alternate index. Now say I have 100 alternate indexes. then the ddname should become ddvsam100 , but the no of characters are invalid. What do I do in such a case.

P.S. I know using 100 alternate indexes is hypothetical and it degrades the performance and we should not be using it , and i have never seen more than two alternate indexes being used. I asked just for my information.
_________________
Thanks and Regards,
Souvik Upadhyay
Back to top
View user's profile Send private message Yahoo Messenger
TomKattt
Beginner


Joined: 03 Aug 2004
Posts: 2
Topics: 1

PostPosted: Wed Aug 04, 2004 3:32 am    Post subject: Reply with quote

Thank you very much. That link had everything I needed to get this accomplished. I wrote a test job to build the VSAM file and I tested a COBOL program to list the data, accessed by both the primary key and the alternate key. I'm good to go. Thanks for the help.
Back to top
View user's profile Send private message
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