View previous topic :: View next topic |
Author |
Message |
TomKattt Beginner
Joined: 03 Aug 2004 Posts: 2 Topics: 1
|
Posted: Tue Aug 03, 2004 7:43 pm Post subject: Coding for VSAM Alternate Index |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
souvik_225 Beginner
Joined: 15 May 2004 Posts: 17 Topics: 2 Location: Mumbai , India
|
Posted: Tue Aug 03, 2004 11:58 pm Post subject: |
|
|
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 |
|
|
TomKattt Beginner
Joined: 03 Aug 2004 Posts: 2 Topics: 1
|
Posted: Wed Aug 04, 2004 3:32 am Post subject: |
|
|
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 |
|
|
|
|