Using Alternate Index in vsam



Help for IBM's record-oriented filesystem VSAM, ESDS, KSDS, RRDS, LDS and Storage management Subsystems

Using Alternate Index in vsam

Postby gowthamgyaa » Mon Nov 05, 2012 6:47 pm

Hi everyone,
I need a help in AIX.
I have a KSDS record as below,
01    RAM    TNR    usa    10    IPDEV    10    20    200    100    100    20    05    15

I have to create an AIX key for the above, so do i need to count fillers ?
for ex: i Need to get region alone, so for that how should i define the key with spaces or without spaces?

Pls help me to solve this.


Kind regards
gyaa
gowthamgyaa
 
Posts: 101
Joined: Wed Sep 05, 2012 11:18 pm
Has thanked: 67 times
Been thanked: 0 time

Re: Using Alternate Index in vsam

 

Re: Using Alternate Index in vsam

Postby Robert Sample » Mon Nov 05, 2012 7:08 pm

I think you are SERIOULSY confused about VSAM alternate indexes. A VSAM alternate index (AIX) is defined as a set of sequential bytes in the record that can be used to read the file in other than the primary key sequence. An AIX may -- or may not -- allow duplicates; if duplicates are allowed there cannot be more than 32767 primary keys with the same alternate index key value. An AIX can be defined anywhere in the record and is accessed through its defined PATH. An AIX record size is not related to the base cluster record length and is defined as 4 + alternate index key length + (n times primary key length), where n is 1 if no duplicates are allowed and the maximum number of duplicate primary keys your application allows if duplicates are okay).

Whether or not you define the AIX key with spaces depends upon the record defintiion and how you are setting up the AIX. This is NOT a question we can answer -- it depends ENTIRELY upon your application and its access requirements, which we cannot tell you since we did not write the specifications for your application.

These users thanked the author Robert Sample for the post:
gowthamgyaa (Mon Nov 05, 2012 7:20 pm)
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Using Alternate Index in vsam

Postby dick scherrer » Mon Nov 05, 2012 9:27 pm

Hello,

By which field(s) do you want to directly access the record(s).

Depending on what really is the requirement, you may need more than one alternate index.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Using Alternate Index in vsam

Postby gowthamgyaa » Mon Nov 05, 2012 10:41 pm

Hello,
Thanks for your reply.
I need to access only region field (USA) in above example.
For this i need to give a key but i am confused to count space or not.


Kind regards
gyaa
gowthamgyaa
 
Posts: 101
Joined: Wed Sep 05, 2012 11:18 pm
Has thanked: 67 times
Been thanked: 0 time

Re: Using Alternate Index in vsam

Postby dick scherrer » Mon Nov 05, 2012 10:57 pm

Hello,

Yup, you are confused . . .<g>

To define an alternate index for that field, you need only define the number of bytes the longest value can be (and the displacement to the first byte). Read about DEFINE ALTERNATEINDEX-

Sggest you find another alternate index definition that is workingon your system and clone it ( making sure you understand each line of the definition.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Using Alternate Index in vsam

Postby NicC » Tue Nov 06, 2012 12:11 am

I know you are on an educational system so I guess you may not find another working alternate index but certainly do the reading.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Using Alternate Index in vsam

Postby Robert Sample » Tue Nov 06, 2012 12:38 am

Whether or not you count the spaces will depend upon whether or not the spaces are part of the field you want to create the alternate index on. If you do not know the answer to this, you need to either reread the documentation you were given for the problem, or talk to your instructor.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times


Return to VSAM/SMS

 


  • Related topics
    Replies
    Views
    Last post