View previous topic :: View next topic
|
Author |
Message |
RITESH BANSAL
New User
Joined: 27 Jan 2010 Posts: 10 Location: Bangalore
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
RITESH BANSAL
New User
Joined: 27 Jan 2010 Posts: 10 Location: Bangalore
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
RITESH BANSAL
New User
Joined: 27 Jan 2010 Posts: 10 Location: Bangalore
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
RITESH BANSAL
New User
Joined: 27 Jan 2010 Posts: 10 Location: Bangalore
|
|
|
|
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 |
|
|
|