IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Alternate Index


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
RITESH BANSAL

New User


Joined: 27 Jan 2010
Posts: 10
Location: Bangalore

PostPosted: Wed Jan 27, 2010 11:38 am
Reply with quote

Hi all,

I have a file which we were using for batch process only earlier and now we have to use that VSAM file for online process but with ALTERNATE KEy.So I need to build the alternate index for that file.The file has primary key of length 71 and that key length also contains ALT KEY as well.
Code:
05 PRIME-KEY.
   07 XYZ-TYPE               PIC  X(01).
   07 XYZ-NUM                 PIC  X(11).
   07 FLD-DELI01                PIC  X(01).
   07 XYS-REMARKS                   PIC  X(25).
   07 XYZ-DELI02                PIC  X(01).
   07 XYZ-ORDER-NUM                 PIC  X(20).
   07 XYZ-DELI03                PIC  X(01).
ALTERNATE KEY #1 IS MODEL AND SERIAL NUMBER
   07 XYZ-ALT-KEY-1.
      09 XYZ-NUM            PIC  X(04).
      09 XYZ-DELI04             PIC  X(01).
      09 XYZ-SERIAL-NUM            PIC  X(06).

But Now I need an alternate Key with XYZ-NUM and Serial and Date also.So Please help me in creating the alternate index for the file.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Jan 27, 2010 5:57 pm
Reply with quote

Quote:
The file has primary key of length 71 and that key length also contains ALT KEY as well.
Why? Primary keys and alternate keys may overlap or even have the entire alternate key contained in the primary key -- but there is no requirement to do so. In your post, is what you called "alternate key #1" the key you're trying to build -- or are you adding a second alternate key?

There is a manuals link at the top of the page. Click on it, find the VSAM Services for DFSMS link, and click on it. You can read all about defining alternate indexes in this manual. If you have any specific questions, please let us know.
Back to top
View user's profile Send private message
RITESH BANSAL

New User


Joined: 27 Jan 2010
Posts: 10
Location: Bangalore

PostPosted: Wed Jan 27, 2010 6:05 pm
Reply with quote

Hi Robert,

Actually Now I want one more field to be in ALT-KEY-1 that is DATE field.So I need to build the AIX for the same file but with ALt-KEY as XYZ-NUM and Serial and Date.

And one more thing this file was earlier used for BATCh program and now I am using this for ONLINE programs also. In this online program I have to read the file with AIX .
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Jan 27, 2010 6:08 pm
Reply with quote

Quote:
Actually Now I want one more field to be in ALT-KEY-1 that is DATE field.So I need to build the AIX for the same file but with ALt-KEY as XYZ-NUM and Serial and Date.

And one more thing this file was earlier used for BATCh program and now I am using this for ONLINE programs also. In this online program I have to read the file with AIX
Is there a question in here somewhere?
Back to top
View user's profile Send private message
RITESH BANSAL

New User


Joined: 27 Jan 2010
Posts: 10
Location: Bangalore

PostPosted: Wed Jan 27, 2010 6:13 pm
Reply with quote

Hi,

I just tried to explain my requirement once again.
Actually I have tried adding third field below the ALT-KEY-1 in copybook and after that I tried building AIX for the file.But what is happening is the data is getting repeated after a particular position in the AIX file. So Please suggest where I am doing wrong.

Thanks in Advance.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Jan 27, 2010 6:39 pm
Reply with quote

Quote:
So Please suggest where I am doing wrong.


You are doing nothing wrong...
looks like Your understanding of alternate indexes is .... wrong

the aix record contains the alternate key and as data all the keys of the records which can be indexed by the same...
if Your alternate key is a subset of the primary key, and the primary key has some repeating patterns, most probably what You see repeated is the common pattern of the primary key
also an aix is not supposed to bye processed by itself...
the data should be accessed thru the path
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Jan 27, 2010 6:48 pm
Reply with quote

Go to www.redbooks.ibm.com and find the VSAM Demystified redbook. Read it and you will understand much about alternate indexes, such as:

1. why there is absolutely NO relationship between the record size for the alternate index and the record size for base cluster
2. how duplicate alternate index keys impact the record size for the alternate index
3. how you will need to get your site support group to modify your CICS region definitions to include the alternate index path name

If the file is used in batch as well as online, you may have to change existing programs to be able to add a field to the alternate index.
Back to top
View user's profile Send private message
RITESH BANSAL

New User


Joined: 27 Jan 2010
Posts: 10
Location: Bangalore

PostPosted: Wed Jan 27, 2010 8:22 pm
Reply with quote

Thanks Robert and Enrico

I think I got my answer, If I have any query I will post that again.Thanks a lot.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Cobol file using index COBOL Programming 2
No new posts DL/I status code AK for GU call using... IMS DB/DC 1
No new posts Add column to existing records using ... JCL & VSAM 2
No new posts choice of clustering index DB2 3
No new posts Secondary index error while loading d... IMS DB/DC 2
Search our Forums:

Back to Top