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 

VSAM -Alternate Index .

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Data Management
View previous topic :: View next topic  
Author Message
karunkallore
Beginner


Joined: 11 Dec 2004
Posts: 103
Topics: 39

PostPosted: Mon Mar 13, 2006 7:17 pm    Post subject: VSAM -Alternate Index . Reply with quote

Hello Friends,

An advice into the scenario listed below would of great help !!



I have a VSAM file ( A KSDS ). It has an alternate index.

As an example for the VSAM file layout.
Code:

Primary Key          Secondary Key
-----------------    ----------------------
1------------------------A
2------------------------B
3------------------------B
4------------------------A

Now i need to read this file from the Top to Bottom. This file has to be read sequentially at the first. After the first read one should be able to get the value in the secondary key position. That is in this case 'A'. Now with this A the application programs does some checking and if those checks are satisfied then it takes that 'A' and it should get all the occurances of 'A' in the file in the secondary key position. The it should table here the primary keys got corresponding to 'A' . In this case '1' and '4'. After reading the entire file through the alternate index for 'A' it should come again and start with the second record 'B'. And the process is repeated for 'B'. Like this , this process should be done for all the entries in the alternate key till end of file of the VSAM file is reached. This has to be done in COBOL. I have used Alternate key and secondary key position in an intermingled way. So please consider both same.

The following are my dilemas:-

1) Could you please let me know how can i do my file definition ? Should it be Dynamic or Sequential ?

2) How to use the START command ( If any i think it is needed as after getting the 'A' value i need to jump directly to next 'A' ) ?


3) To use READ or READ NEXT ?

Kindly if a sample code is given in the forum it would be great for me to undertand ?

Thanks in advance a lot !!!

Karun.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Data Management 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