IDCAMS: Catalogs and Aliases

[◀ JCL Batch Jobs]

Contents

  1. Displaying the contents of a catalog
  2. Defining an user catalog with an alias
  3. Defining a master catalog
  4. Creating a catalog backup
  5. Defining a VVDS (VSAM volume data set)
  6. Defining an alias
  7. Deleting an alias
  8. Deleting an user catalog
  9. Deleting an user catalog with RECOVERY
  10. Deleting an user catalog with FORCE

Displaying the contents of a catalog [▲ Top]

//*
//* +----1----+----2----+----3----+----4----+----5----+----6----+----7-
//*
//STEP1   EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
 LISTCAT ALL CAT(cat.name)
/*

Defining an user catalog with an alias [▲ Top]

And of course connecting to the master catalog.

//*
//* +----1----+----2----+----3----+----4----+----5----+----6----+----7-
//*
//STEP1   EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
 DEFINE UCAT(                                              -
             NAME(ucat.name)                               -
             VOLUME(volser)                                -
             CYL(5,1)                                      -
             ICFCATALOG                                    -
             ECSHARING                                     -
            )
/*
//STEP2   EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
 DEFINE ALIAS(                                             -
              NAME(aliasname)                              -
              RELATE(ucat.name)                            -
             )
/*
//STEP3   EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
 IMPORT CONNECT                                            -
        OBJECTS((                                          -
                 ucat.name                                 -
                 DEVICETYPE(3390)                          -
                 VOLUMES(volser)                           -
               ))                                          -
        CATALOG(mcat.name)
/*

Defining a mster catalog [▲ Top]

//*
//* +----1----+----2----+----3----+----4----+----5----+----6----+----7-
//*
//STEP1   EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
 DEFINE MCAT (                                             -
              ICFCATALOG                                   -
              NAME(mcat.name)                              -
              VOL(volser)                                  -
              CYL(10 1)                                    -
              FREESPACE(10 10)                             -
              SHR(3 4)                                     -
              STRNO(3)                                     -
             )                                             -
        DATA (                                             -
              CISZ(4096)                                   -
              BUFND(4)                                     -
             )                                             -
        INDEX(                                             -
              BUFNI(4)                                     -
             )
/*

Creating a catalog backup [▲ Top]

//*
//* +----1----+----2----+----3----+----4----+----5----+----6----+----7-
//*
//STEP1   EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//BACKUP   DD  DISP=(,CATLG),DSN=backup.cat.name,
//             SPACE=(CYL,(20,5),RLSE)
//SYSIN    DD  *
 EXPORT cat.name                                           -
        OUTFILE(BACKUP)                                    -
        TEMPORARY
/*

Defining a VVDS (VSAM volume data set) [▲ Top]

//*
//* +----1----+----2----+----3----+----4----+----5----+----6----+----7-
//*
//STEP1   EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
 DEFINE CLUSTER(                                           -
                NAME(SYS1.VVDS.Vvolser)                    -
                TRACKS(10 10)                              -
                VOLUMES(volser)                            -
                NONINDEXED                                 -
               )
/*

Defining an alias [▲ Top]

//*
//* +----1----+----2----+----3----+----4----+----5----+----6----+----7-
//*
//STEP1   EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
 DEFINE ALIAS(                                             -
              NAME(aliasname)                              -
              RELATE(ucat.name)                            -
             )
/*

using system symbols with SYMBOLICRELATE

//*
//* +----1----+----2----+----3----+----4----+----5----+----6----+----7-
//*
//STEP1   EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
 DEFINE ALIAS(                                             -
              NAME(aliasname)                              -
              SYMBOLICRELATE(ucat.&symbol..name)           -
             )
/*

Deleting an alias [▲ Top]

//*
//* +----1----+----2----+----3----+----4----+----5----+----6----+----7-
//*
//STEP1   EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
 DELETE aliasname                                          -
        ALIAS                                              -
        CATALOG(mcat.name)
/*

Deleting an user catalog [▲ Top]

The user catalog must be empty.

//*
//* +----1----+----2----+----3----+----4----+----5----+----6----+----7-
//*
//STEP1   EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
 EXPORT ucat.name                                          -
        DISCONNECT
/*
//STEP2   EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
 DELETE ucat.name UCAT
/*

Deleting an user catalog with RECOVERY [▲ Top]

Deletes a user catalog even if it is not empty.

//*
//* +----1----+----2----+----3----+----4----+----5----+----6----+----7-
//*
//STEP1   EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
 EXPORT ucat.name                                          -
        DISCONNECT
/*
//STEP2   EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
 DELETE ucat.name UCAT                                     -
        RECOVERY
/*

Deleting an user catalog with FORCE [▲ Top]

//*
//* ***************************************************************** *
//*                                                                   *
//* Attention!                                                        *
//* The FORCE option will also delete the alias to the catalog and    *
//* all datasets which are cataloged in this user catalog             *
//*                                                                   *
//* ***************************************************************** *
//*
//* +----1----+----2----+----3----+----4----+----5----+----6----+----7-
//*
//STEP1   EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
 EXPORT ucat.name                                          -
        DISCONNECT
/*
//STEP2   EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
 DELETE ucat.name UCAT                                     -
        FORCE
/*

Kommentar verfassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.

Wir benutzen Cookies um die Nutzerfreundlichkeit der Webseite zu verbessen. Durch Deinen Besuch stimmst Du dem zu.