IDCAMS - Access Method Services

A utility used to create, delete, load, backup and print VSAM files. It is also used to create alternate indexes.

The JCL is as follows:

Statements should begin in column 2. A hyphen is used at the end of a line to continue a statement on the next line.

DELETE (X) CL ­ This control statement deletes the VSAM cluster named X. The data component, the index component and any alternate indexes are deleted.

Example:

DELETE (S460230.MASTER) CL

DEFINE CLUSTER ­ This statement creates a new VSAM cluster. The various parameters for this statement describe the file in more detail.

Example:

DEFINE CLUSTER ­

(NAME(S460201.MASTER) INDEXED ­

RECORDSIZE(60 60) KEYS(9 0) ­

RECORDS(50 20) FREESPACE(20 20)) ­

DATA(NAME(S460201.MASTERD)) ­

INDEX(NAME(S460201.MASTERI))

REPRO input-parameter output-parameter other-parameters

REPRO can be used to:

1) Load a VSAM file from a sequential file

2) Copy a VSAM file to a sequential file as when doing backups

3) Copy a VSAM file to another VSAM file

4) Copy a sequential file to another sequential file

Parameters are:

Data must be sorted in ascending sequence on the key field when copying into a VSAM file.

Examples:

REPRO INFILE(INPUTDD) ODS(S460201.MASTER)

REPRO IDS(S460201.MASTER) OUTFILE(OUTDD)

REPRO IDS(S460201.MASTER) ODS(S460201.TEST.MASTER) -

SKIP(100) COUNT(50)

PRINT input-parameter other-parameters

PRINT can be used to print all or selected records from a VSAM file. The default is to print the entire file.

Parameters are:

Examples (assuming VSAM file key length=5):

PRINT IDS(S460201.MASTER) FROMKEY('10000') TOKEY('20000')

PRINT IDS(S460201.MASTER) COUNT(10) DUMP

PRINT IDS(S460201.MASTER) TOKEY('30000')


LISTCAT

LISTCAT displays information about an MVS dataset.

Parameters are:

Examples:

LISTCAT ENT(S460201.MASTER) ALL

LISTCAT LEVEL(S460201)

The following job will delete a VSAM cluster if it exists, define a new VSAM cluster and then load it with data.

//jobname JOB (46020xx,SL),LUGNUT,USER=S4602xx,PASSWORD=pppppp,

// REGION=900K

// EXEC PGM=IDCAMS

//LOADIT DD DSN=$4602.VSAM.DATA,DISP=SHR

//SYSPRINT DD SYSOUT=A

//SYSIN DD * ****** Control Statements follow ******

DELETE (S4602xx.MASTER) CL

DEFINE CLUSTER ­

(NAME(S4602xx.MASTER) INDEXED ­

RECORDSIZE(80 80) KEYS(9 0) ­

RECORDS(50 20) FREESPACE(20 20)) ­

DATA(NAME(S4602xx.MASTERD)) ­

INDEX(NAME(S4602xx.MASTERI))

REPRO INFILE(LOADIT) ODS(S4602xx.MASTER)

//

Where: 'jobname' is any valid jobname

'xx' is a subaccount#

'pppppp' is the RACF password