28.09.
2012

IDCAMS

[◀ JCL Batch Jobs]

Contents

  1. Renaming a VSAM dataset
  2. Deleting a VSAM dataset
  3. Deleting a catalog entry
  4. Copying a VSAM dataset

Renaming a VSAM dataset [▲ Top]

//*
//* +----1----+----2----+----3----+----4----+----5----+----6----+----7-
//*
//STEP1   EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
 ALTER dataset.name                                        -
       NEWNAME(new.dataset.name)
/*

Deleting a VSAM dataset [▲ Top]

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

Deleting a catalog entry [▲ Top]

Use DELETE NOSCRATCH (NSCR) to delete only the catalog entry from a VSAM dataset.

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

Copying a VSAM dataset [▲ Top]

//*
//* +----1----+----2----+----3----+----4----+----5----+----6----+----7-
//*
//      EXPORT SYMLIST=(SOURCE,TARGET)
//*
//         SET  SOURCE=DSN1
//         SET  TARGET=DSN2
//*
//* *******************************************************************
//VSAMCP  PROC
//ALLOC1  EXEC PGM=IDCAMS,DYNAMNBR=1
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *,SYMBOLS=EXECSYS
  DELETE ('&TARGET.') CLUSTER PURGE
  IF MAXCC LE 8 THEN DO
     SET MAXCC = 0
  END

  DEFINE CLUSTER(                      -
     NAME('&TARGET.')                  -
     MODEL('&SOURCE.')                 -
  )
/*
//COPY1   EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=A
//INDD     DD  DISP=SHR,DSN=&SOURCE.
//OUTDD    DD  DISP=SHR,DSN=&TARGET.
//SYSIN    DD  *
  REPRO                                  -
    INFILE(INDD)                         -
    OUTFILE(OUTDD)
/*
//        PEND
//* *******************************************************************
//*
//* +----1----+----2----+----3----+----4----+----5----+----6----+----7-
//*
//COPY1   EXEC VSAMCP,
//             SOURCE=dataset.name1,
//             TARGET=dataset.newname1
//COPY2   EXEC VSAMCP,
//             SOURCE=dataset.name2,
//             TARGET=dataset.newname2
/*

Kein Kommentar

Kommentieren

Dein Kommentar

*

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