Utility to Create VSAM


  • An access method represents the process that is used to store and retrieve data from the datasets or files.
  • Access methods have their own dataset structures to manage data, system-provided programs to define datasets, and utility programs to process datasets.
  • Access Method Services (AMS) is a utility mainly used to define and handle VSAM datasets and integrated catalogs.
  • IDCAMS(Integrated Data Cluster Access Method Services) is the utility program name for access method services (AMS) and used to create the VSAM datasets.
  • The functions of AMS are performed through the different functional commands of IDCAMS.

IDCAMS utility can be invoked in the following three ways -

  1. Call from the Application program
  2. Batch mode
  3. With TSO commands.

Syntax - Batch mode

//JOBNAME  JOB job-card-parameters
//STEP1    EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=A
//SYSIN    DD *
  AMS commands and their parameters
/*

The below are AMS commands of IDCAMS -

AMS Command Description
DEFINE Creates catalogs and catalog entries for files, alternate indexes, paths, and VSAM data spaces.
ALTER Alters the existing catalog entries.
LISTCAT Lists catalog entries.
PRINT Prints VSAM and nonVSAM files.
REPRO
  • Copies files.
  • Converts sequential and indexed-sequential files to VSAM format.
  • Converts VSAM and indexed-sequential files to sequential format.
  • Creates backup copies of VSAM catalogs.
  • Reloads a VSAM catalog from a backup copy.
EXPORT Creates a copy of a file for backup or makes a file or user catalog portable to use in another system.
IMPORT Reads a backup copy of a file or makes a file or user catalog previously exported available in another system.
VERIFY Provoke a catalog to correctly reflect the end of a file.
DELETE Deletes catalog entries.

Guidelines for coding commands in IDCAMS -


  • At least one blank space must be between the command, the object, and sub-parameter values.
  • Sub parameter values can be separated using a space or a comma.
  • Space is optional between a parameter and the parenthesis enclosing its values.
  • A hyphen (-) is used to specify the current line extended to the following line.
  • Multiple parameters can be coded on a line. Still, it is better to place each on a line by itself for better readability.
  • A parameter and a sub-parameter cannot be separated from a hyphen. A plus sign should be used for this purpose.

IDCAMS utility is explained in utilities section .