Friday, 12 April 2019

How to define VSAM CLUSTER / VSAM File? | Command to define VSAM Database.

Virtual Storage Access Method.
To create a VSAM dataset/ VSAM file you need to use AMS (i.e. Access Method Service). 

Most of the ASM commands are used very often and almost every mainframe application programmer remember these commands.
  
As you can see, these include commands for defining all three types of VSAM datasets / Clusters, for defining and building alternate indexes for key-sequenced data sets, and for listing catalog information. 

However, there are basically two ways of defining a cluster i.e. maybe you can use JCL or ISPF panel. 

Access Method Service
ISPF panel to define VSAM cluster.


The DEFINE CLUSTER command is used to define a KSDS, ESDS, or RRDS. 

Please note that parameters at the CLUSTER level apply to the entire cluster and parameters at the DATA or INDEX level apply only to the data or index component. 



The DEFINE CLUSTER command Syntax: 

DEFINE CLUSTER (   NAME(entry-name)
                 [ OWNER(owner-id) ]
                 [ FOR(days) | TO(date) ]
                 [ INDEXED | NONINDEXED | NUMBERED | LINEAR]
                 [ RECORDSIZE(avg max) ] 
                 [ KEYS(length offset) ]
                 [ SPANNED | NONSPANNED ] 
                 [ CISZ(size) ]
                 [ FREESPACE(ci ca) ]
                 [ VOLUMES(vol-ser…) ]
                 [ FILE(ddname) ]
                 [ {CYLINDERS(primary [secondary])}
                   {KILOBYTES(primary [secondary])}
                   {MEGABYTES(primary [secondary])}
                   {TRACKS(primary [secondary])   }
                   {RECORDS(primary [secondary])  } ]
                 [ REUSE | NOREUSE ]
                 [ SHAREOPTIONS(a b) ]
                 [ IMBED | NOIMBED ]     )
                 [ STORAGECLASS(storage-class) ]
                 [ DATACLASS(data-class) ]
                 [ MANAGEMENTCLASS(management-class) ] )
 [ DATA        ( [ NAME(entry-name) ]
                 [ VOLUMES(vol-ser…) ]
                 [ FILE(ddname) ] 
                 [ CISZ(size) ]
                 [ {CYLINDERS(primary [secondary])}
                   {KILOBYTES(primary [secondary])}
                   {MEGABYTES(primary [secondary])}
                   {TRACKS(primary [secondary])   }
                   {RECORDS(primary [secondary])  } ] ) ]
 [ INDEX       ( [ NAME(entry-name) ]
                 [ VOLUMES(vol-ser…) ]
                 [ {CYLINDERS(primary [secondary])}
                   {KILOBYTES(primary [secondary])}
                   {MEGABYTES(primary [secondary])}
                   {TRACKS(primary [secondary])   }
                   {RECORDS(primary [secondary])  } ] ) ]
 [ CATALOG(name) ]


Example of how to use the Defines cluster command for a KSDS dataset.
DEFINE CLUSTER  ( NAME(RC01.CUST.MNTHLY.FLE)          -
                  INDEXED                             -
                  RECORDSIZE(200 200)                 -
                  KEYS(6 0)                           -
                  VOLUMES(TSO201) )                   -
       DATA     ( NAME(RC01.CUST.MNTHLY.FLE.DATA)     -
                  CYLINDERS(70 5)                     -
                  CISZ(4096) )                        -
       INDEX    ( NAME(RC01.CUST.MNTHLY.FLE.INDEX) )


VSAM Cluster share
How to use the DEFINE CLUSTER command share.

No comments:

Post a comment