Defining VSAM files

You can process VSAM entry-sequenced, key-sequenced, and relative-record data sets in Enterprise COBOL only after you define them through access method services (IDCAMS).

About this task

A VSAM cluster is a logical definition for a VSAM data set and has one or two components:

  • The data component of a VSAM cluster contains the data records.
  • The index component of a VSAM key-sequenced cluster consists of the index records.

Use the DEFINE CLUSTER access-method services command to define VSAM data sets (clusters). This process includes creating an entry in an integrated catalog without any data transfer. Define the following information about the cluster:

  • Name of the entry
  • Name of the catalog to contain this definition and its password (can use default name)
  • Organization (sequential, indexed, or relative)
  • Device and volumes that the data set will occupy
  • Space required for the data set
  • Record size and control interval sizes (CISIZE)
  • Passwords (if any) required for future access

Depending on what kind of data set is in the cluster, also define the following information for each cluster:

  • For VSAM indexed data sets (KSDS), specify length and position of the prime key in the records.
  • For VSAM fixed-length relative-record data sets (RRDS), specify the record size as greater than or equal to the maximum size COBOL record:
    
    DEFINE CLUSTER NUMBERED
    RECORDSIZE(n,n)
    

    If you define a data set in this way, all records are padded to the fixed slot size n. If you use the RECORD IS VARYING ON data-name form of the RECORD clause, a WRITE or REWRITE uses the length specified in DEPENDING ON data-name as the length of the record to be transferred by VSAM. This data is then padded to the fixed slot size. READ statements always return the fixed slot size in the DEPENDING ON data-name.

  • For VSAM variable-length relative-record data sets (RRDS), specify the average size COBOL record expected and the maximum size COBOL record expected:
    
    DEFINE CLUSTER NUMBERED
    RECORDSIZE(avg,m)
    

    The average size COBOL record expected must be less than the maximum size COBOL record expected.

Related references  
z/OS® DFSMS: Access Method Services for Catalogs