My favourite IDCAMS commands.

As part of my working with ADCD and having to do every system programmer task myself, it is easy to get into trouble by having all data sets cataloged in the master catalog. When you come to move to a newer level of ADCD, all of your datasets are cataloged in the old catalog.

It is better to create a user catalog for dataset you create, and create an alias, so the datasets are cataloged in your user catalog. You just have to import the catalog when you move to the newer level, and recreate the aliases and your data sets will all be visible.

I tend to use JCL like

//IBMDF JOB 1,MSGCLASS=H
// EXPORT SYMLIST=*
// SET NAME=PKISRVD
//* CHANGE THE NAME IN THE RELATE TO YOUR CATALOG
//S1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*,SYMBOLS=JCLONLY
LISTCAT ENTRIES(‘&NAME’) ALL
/*

and change the value in the SET statement.

Define a user catalog

DEFINE USERCATALOG –
( NAME(‘&NAME’) –
MEGABYTES(15 15) –
VOLUME(&VOL) –
ICFCATALOG –
FREESPACE(10 10) –
STRNO(3 ) ) –
DATA( CONTROLINTERVALSIZE(4096) –
BUFND(4) ) –
INDEX(BUFNI(4) )

List a user catalog

LISTCAT ENTRIES(‘&NAME’) ALL

Delete a user catalog

DELETE –
&NAME –
PURGE –
USERCATALOG

Create an alias to map a HLQ to a user catalog

DEFINE ALIAS (NAME(ZZZZ) RELATE(‘A4USR1.ICFCAT’) )

Delete an alias

DELETE ‘ZZZZ’ ALIAS

List data sets under an alias

LISTCAT ENTRIES(‘ZZZZ’ ) ALL

One thought on “My favourite IDCAMS commands.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s