10 Sept 2012

How to create a VSAM

Below step explains how to create a VSAM KSDS using IDCAMS utility.
//STEP          EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN         DD *
         DEFINE CLUSTER ( -
                 NAME(MY.VSAM.CREATE) -
                 TRACKS(5 5) -
                 VOLUME(TST232) -

                 CONTROLINTERVALSIZE(4096) -
                 ERASE -
                 FREESPACE(2 1) -
                 KEYS(10 5) -
                 RECORDSIZE(80 80) -

                 INDEXED -
                 NOREUSE -
                 NO REPLICATE -
       )DATA( -
             NAME(MY.VSAM.CREATE.DATA) -
       )INDEX( -
            NAME(MY.VSAM.CREATE.INDEX) -
       ) 

  • DEFINE      - To create a new VSAM.
  • NAME         - Name of VSAM.
  • TRACKS    - Space allocation of the VSAM.
  • VOLUMES – One or more DASD Volumes on which it created. 
  • CONTROLINTERVALSIZE – Size of the Control-Interval.It defaults to 4096 Bytes.
  • ERASE –  When the Cluster is Deleted, the space must be over-written with Binary Zeroes, prior to marking the space free for Re-use. 
  • FREESPACE(ci ca) – The percentage of space to be left unallocated for future expansion.
  • KEYS   This is used to tell the Key Column.10 is the length of the Key, and 5 is the starting position of the key. 
  • RECORDSIZE – Logical-Reocrds in the VSAM File.
  • INDEXED– This tells the Type of Cluster – KSDS(Data is accessed using Key Value).

No comments:

Post a Comment