Interview Questions   Tutorials   Discussions   Programs   Discussion   

VSAM - What is an alternate index and path ?




546
views
asked mar August 24, 2014 12:13 PM  

What is an alternate index and path ?


           

1 Answers



 
answered By Mswami   0  
An alternate index provides access to the records in a data set that uses more than one key. It accesses records in the same way as the prime index key of an indexed data set (KSDS).

When planning to use an alternate index, you must know:

  •     The type of data set (base cluster) with which the index will be associated
  •     Whether the keys will be unique or not unique
  •     Whether the index is to be password protected
  •     Some of the performance aspects of using alternate indexes

Define Alternate index:

//IND220AX JOB OZA,OZA,MSGLEVEL=(1,1),             
//       CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID        
//***************************************************      
//*SAMPLE JCL TO CREATE ALTERNATE INDEX             
//***************************************************      
//STEPOZA EXEC PGM=IDCAMS                   
//SYSPRINT DD SYSOUT=*                     
//SYSOUT  DD SYSOUT=*                     
//SYSIN  DD *                        
 DEFINE AIX -                         
 (NAME(IND220.INDUS.STUDENT.CLUSTER.ALX) -           
 RELATE(IND220.INDUS.STUDENT.CLUSTER) -            
 CISZ(4096) -                         
 KEYS(20,4) -                         
 NONUNIQUEKEY -                        
 UPGRADE-                           
 RECORDSIZE(29,29)-                      
 CYLINDERS(3,2)-                        
 FREESPACE(10,20)-                       
 )                               
/*                               
//                               
Because an alternate index is, in practice, a VSAM data set that contains pointers to the keys of a VSAM data set, you must define the alternate index and the alternate index path (the entity that establishes the relationship between the alternate index and the prime index). After you define an alternate index, make a catalog entry to establish the relationship (or path) between the alternate index and its base cluster. This path allows you to access the records of the base cluster through the alternate keys.

Define path:


//IND220PT JOB OZA,OZA,MSGLEVEL=(1,1),             
//       CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID        
//***************************************************      
//*SAMPLE JCL TO DEFINE PATH                  
//***************************************************      
//STEPOZA EXEC PGM=IDCAMS                   
//SYSPRINT DD SYSOUT=*                     
//SYSIN  DD *                        
 DEFINE PATH (NAME(IND220.INDUS.STUDENT.CLUSTER.PATH) -    
        PATHENTRY(IND220.INDUS.STUDENT.CLUSTER.ALX) UPDATE
/*                               
//                               
flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert