Data and storage management on z/OS
Previous topic | Next topic | Contents | Glossary | Contact z/OS | PDF


IDCAMS: Use access method services for catalogs

Data and storage management on z/OS

Although it provides other functions, IDCAMS, which is the program name for access method services, is used primarily to define and manage VSAM data sets and integrated catalog facility catalogs.

An access method defines the technique that is used to store and retrieve data. Access methods have their own data set structures to organize data, system-provided programs (or macros) to define data sets, and utility programs to process data sets. VSAM (Virtual Sequential Access Method) is an access method used for more complex applications. VSAM arranges records by an index key, relative record number, or relative byte addressing.

Some users pronounce the name of this program as "id-cams" (two syllables) while others say "I-D-cams" (three syllables).

A typical example of a simple use of IDCAMS is as follows:
//VDFNDEL  JOB 1,LINDAJO,MSGCLASS=X
//STEP1    EXEC PGM=IDCAMS
//SYSPRINT DD *
//DATAIN   DD DISP=OLD,DSN=LINDA.SORTOUT
//SYSIN    DD *
 DEFINE CLUSTER (NAME (LINDA.DATA.VSAM) -
 VOLUMES(WORK02) CYLINDERS(1 1) -
 RECORDSIZE (72 100) KEYS(9 8) INDEXED)
 REPRO INFILE(DATAIN) OUTDATASET(LINDA.DATA.VSAM) ELIMIT(200)
/*
//STEP2    EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *
 DELETE LINDA.DATA.VSAM CLUSTER
/*
This sample job, named VDFNDEL, consists of two steps: One to define a VSAM data set; the other to delete it. The first step, STEP1 performs two functions:
  1. Creates a VSAM data set through the DEFINE CLUSTER command. Note that IDCAMS uses dynamic allocation to create the necessary JCL for this new data set, so the sample does not include a DD statement for the new data set.
    • The DEFINE CLUSTER command is continued over three records; the continuation indicators are hyphens.
    • The VSAM data set is on volume WORK02, and uses one cylinder for primary space and one cylinder for secondary allocation. The average record size is 72 bytes and the maximum record size is 100 bytes. (VSAM data sets always use variable length records.) The primary key (for accessing records in the data set) is 8 bytes long and begins at an offset of 9 bytes into each record.
    • Records for loading a VSAM data set this way should already be sorted into key order.
    • The ELIMIT parameter specifies the number of error records that REPRO will ignore before terminating operation. An error record is usually due to a duplicate key value.
  2. Loads the new data set through the REPRO command. The input loaded into the new data set comes from a sequential data set, which is identified through the DATAIN DD statement.
The second step, STEP2, deletes the data set that is created STEP1.

Many of IDCAMS functions can be entered as TSO commands. For example, DEFINE CLUSTER can be used as a TSO command. However, using IDCAMS in this manner is generally not recommended because these commands can be complex and the errors encountered can be complex. Entering the IDCAMS commands through a batch job allows the commands and resulting messages to be reviewed as often as necessary by using SDSF to view the output.





Copyright IBM Corporation 1990, 2010