Tags

, , , , , , , , , ,

IDCAMS

IDCAMS is the Access Method Services program. IDCAMS program is useful in creating VSAM, GDG and PS file by supplying AMS commands thru SYSIN. The below examples are very useful in coding the requirements for VSAM and GDG users.

Defining VSAM ESDS

//ESDS JOB ‘ESDS’,’YYY’,CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *

                   DEFINE CLUSTER                  –
(                               –
NAME(XXXXXX.YYY.ESDS)           –
TRACKS(4,2)                    –
CONTROLINTERVALSIZE(4096)       –
RECORDSIZE(80,80)               –
NONINDEXED                   –
)    –
DATA                   –
(                          –
NAME(XXXXXX.YYY.ESDS.DATA) –
)
/*

//

Defining VSAM RRDS

//RRDS JOB ‘XXXXXX’,’YYY’,CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE CLUSTER –
( –
NAME(XXXXXX.YYY.RRDS) –
TRACKS(4,2) –
CONTROLINTERVALSIZE(4096) –
RECORDSIZE(80,80) –
NUMBERED –
) –
DATA –
( –
NAME(XXXXXX.YYY.RRDS.DATA) –
)
/*
//

Defining VSAM KSDS

//KSDS JOB ‘XXXXXX’,’YYY’,CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE CLUSTER –
( –
NAME(XXXXXX.YYY.KSDS) –
TRACKS(4,2) –
CONTROLINTERVALSIZE(4096) –
RECORDSIZE(80,80) –
FREESPACE(10,20) –
KEYS(10,1) –
) –
DATA –
( –
NAME(XXXXXX.YYY.KSDS.DATA) –
) –
INDEX –
( –
NAME(XXXXXX.YYY.KSDS.INDEX) –
CONTROLINTERVALSIZE(2048) –
)
/*
//

Defining Alternate Index

//AIX JOB ‘XXXXXX’,’YYY’,CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE AIX –
( –
NAME(XXXXXX.YYY.AIX) –
RELATE(XXXXXX.YYY.KSDS) –
TRACKS(4,2) –
NONUNIQUEKEY –
UPGRADE –
RECORDSIZE(80,80) –
FREESPACE(10,20) –
KEYS(5,11) –
) –
DATA –
( –
NAME(XXXXXX.YYY.AIX.DATA) –
) –
INDEX –
( –
NAME(XXXXXX.YYY.AIX.INDEX) –
)
/*
//

Defining Path for AIX

//PATH JOB ‘XXXXXX’,’YYY’,CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE PATH –
( –
NAME(XXXXXX.YYY.PATH) –

 

PATHENTRY(XXXXXX.YYY.AIX) –
UPDATE –
)
/*
//

Defining GDG

//GDG JOB ‘XXXXXX’,’YYY’,CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE GDG –
( –
NAME(XXXXXX.YYY.GDG) –
LIMIT(10) –
NOEMPTY –   <= NOEMPTY <-> EMPTY
SCRATCH –   <= SCRATCH <-> NOSCRATCH
)
/*
//

Loding a KSDS File

//LOAD JOB ‘XXXXXX’,’YYY’,CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REPRO –
INDATASET(XXXXXX.YYY.KSDS) –   <= INFILE FOR PDS
OUTDATASET(XXXXXX.YYY.PS)      <= MAY BE A VSAM/PDS
/*
//

Altering GDG, VSAM or PS File

//ALTER JOB ‘XXXXXX’,’YYY’,CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
ALTER –
XXXXXX.YYY.PS –
NEWNAME(LEM0I01YYY.PS1)
ALTER XXXXXX.YYY.KSDS.INDEX –
INHIBIT      <= INHIBIT <-> UNINHIBIT
ALTER –
XXXXXX.YYY.GDG EMPTY NOSCRATCH
/*
//

Deleting GDG, VSAM or PS file

//DELETE JOB ‘XXXXXX’,’YYY’,CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE XXXXXX.YYY.PSCPY      <=MAY BE VSAM/PDS
DELETE XXXXXX.YYY.GDG FORCE    <= FORCE <-> PURGE
/*
//

Printing a VSAm file

//PRINT JOB ‘XXXXXX’,’YYY’,CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
PRINT –
INDATASET(XXXXXX.YYY.KSDS) –     <= INFILE FOR PDS
DUMP              <= DUMP <-> CHAR <-> HEX
/*
//

Important SQL CODES and ABEND CODES
SORT JOIN – TO JOIN TWO FILES BASED ON A KEY
KNOW YOUR MAINFRAME
REXX – INITIAL SETUP
IDCAMS – Define VSAM ESDS
IDCAMS – Define VSAM RRDS
IDCAMS – Define VSAM KSDS
IDCAMS – Define Alternate Index (AIX)
IDCAMS – Define PATH for Alternate Index
IDCAMS – Define GDG
IDCAMS – Alter GDG, VSAM or PS File
IDCAMS – Delete GDG, VSAM or PS File
IDCAMS – Print VSAM File
IDCAMS
Recovery of Deleted Tape data set (Using Volume Serial)
JCL – SYSIN CONCATENATION
JCL – RUN ONLY ONE MIDDLE STEP (RESTART)
GDG – Delete Just Versions Not BASE
JCL – COPY DCB OF INPUT FILE TO OUTPUT FILE
HOW TO SUBMIT A JOB AUTOMATICALLY AFTER A JOB FINISHES
DELETE ALL GDG VERSIONS WITHOUT DELETING BASE
LISTCAT – BATCH JOB
IEBCOPY Examples
IEBGENER – INTERNAL READER TO SUBMIT
Delete Multiple datasets with same HLQ
JCL INTERVIEW QUESTIONS
JCL TIPS
Advertisements