VSAM - Example: entries for alternate indexes - www.cadcobol.com.br



Desenvolvido por DORNELLES Carlos Alberto - Analista de Sistemas - Brasília DF. - cad_cobol@hotmail.com

Example: entries for alternate indexes

Enterprise COBOL for z/OS, Version 4.2, Programming Guide


The following example maps the relationships between the COBOL FILE-CONTROL entry and the DD statements or environment variables for a VSAM indexed file that has two alternate indexes.

Using JCL:

   //MASTERA     DD   DSNAME=clustername,DISP=OLD   (1)
   //MASTERA1    DD   DSNAME=path1,DISP=OLD         (2)
   //MASTERA2    DD   DSNAME=path2,DISP=OLD         (3)

Using environment variables:

   export MASTERA=DSN(clustername),OLD              (1)
   export MASTERA=DSN(path1),OLD                    (2)
   export MASTERA=DSN(path2),OLD                    (3)
   . . . 
       FILE-CONTROL. 
             SELECT MASTER-FILE ASSIGN TO MASTERA              (4)
                    RECORD KEY IS EM-NAME
                    PASSWORD IS PW-BASE                        (5)
                    ALTERNATE RECORD KEY IS EM-PHONE           (6)
                    PASSWORD IS PW-PATH1 					 
                    ALTERNATE RECORD KEY IS EM-CITY            (7)
                    PASSWORD IS PW-PATH2.
  • (1) - The base cluster name is clustername.
  • (2) - The name of the first alternate index path is path1.
  • (3) - The name of the second alternate index path is path2.
  • (4) - The ddname or environment variable name for the base cluster is specified with the ASSIGN clause.
  • (5) - Passwords immediately follow their indexes.
  • (6) - The key EM-PHONE relates to the first alternate index.
  • (7) - The key EM-CITY relates to the second alternate index.

Related tasks:



© Copyright tutorialspoint.com