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 alias to catalog reference

LISTCAT ENTRIES(‘ZZZZ’ ) ALL

This just tells you the alias exists and which user catalog it uses.

List data sets under an alias

LISTCAT ENT(CEE.*) ALL

gives

LISTCAT ENTRIES(CEE.* ) ALL
...
ALIAS --------- CEE.SCEEBIND                                                      
     IN-CAT --- ICFCAT.PLEXH.CATALOG3                                             
     HISTORY                                                                      
       RELEASE----------------2     CREATION--------0000.000                      
     ENCRYPTIONDATA                                                               
       DATA SET ENCRYPTION-----(NO)                                               
     ASSOCIATIONS                                                                 
       SYMBOLIC-PP.ADLE370.&SYSLEVEL..SCEEBIND                                    
       RESOLVED-PP.ADLE370.ZOS204.SCEEBIND                                        

So we can see that the catalog uses system symbolics: SYSLEVEL. On the current system this is ZOS204. When zOS205 is used, the symbolic will be updated, and all of the datasets will get the new value. The resolved value (what it is now) is RESOLVED PP.ADLE370.ZOS204.SCEEBIND

2 thoughts 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 )

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