Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Alternate Index

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: Alternate Index
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: 8054
Location: East Dubuque, Illinois, USA

PostPosted: Wed Jan 27, 2010 5:57 pm    Post subject:
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    Post subject:
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: 8054
Location: East Dubuque, Illinois, USA

PostPosted: Wed Jan 27, 2010 6:08 pm    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10255
Location: italy

PostPosted: Wed Jan 27, 2010 6:39 pm    Post subject: Reply to: Alternate Index
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: 8054
Location: East Dubuque, Illinois, USA

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

Go to http://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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts setting new limit Key values for inde... srilata83 DB2 1 Fri Feb 10, 2017 9:24 pm
No new posts Order BY AND Index Nileshkul DB2 2 Sat Dec 31, 2016 6:33 pm
No new posts Several errors during building altern... Andi1982 JCL & VSAM 11 Wed Jul 06, 2016 7:39 pm
No new posts Drop building Alternate Index for a p... bhavin.mehta JCL & VSAM 6 Mon Jul 04, 2016 3:47 pm
No new posts VSAM Alternate Index in CICS jacobdng CICS 2 Fri May 06, 2016 1:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us