JCL Example Sample Reference Code


1. JCL to create a PS dataset(s)

//RACFID01 JOB 1,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//*******************************************************************************
//** JCL TO CREATE A PS DATASET
//*******************************************************************************
//STEP001  EXEC PGM=IEFBR14
//DD1      DD DSN=RACFID.IBMMF.PS1,
//            DISP=(MOD,CATLG,DELETE),
//            SPACE=(TRK,(10,100),RLSE),
//            DCB=(LRECL=80,RECFM=FB,BLKSIZE=800,DSORG=PS)
//*
//DD2      DD DSN=RACFID.IBMMF.PS2,
//            DISP=(MOD,CATLG,DELETE),
//            SPACE=(TRK,(10,100),RLSE),
//            DCB=(LRECL=80,RECFM=FB,BLKSIZE=800,DSORG=PS)
//*

2. JCL to delete a PS dataset(s)

//RACFID02 JOB 2,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//*******************************************************************************
//* JCL TO DELETE A PS DATASET
//*******************************************************************************
//STEP001  EXEC PGM=IEFBR14
//DD1      DD DSN=RACFID.IBMMF.PS1,
//            DISP=(OLD,DELETE,DELETE)
//*
//DD2      DD DSN=RACFID.IBMMF.PS2,
//            DISP=(OLD,DELETE,DELETE)
//*

3. JCL to create a PDS dataset(s)

//RACFID03 JOB 3,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//*******************************************************************************
//* JCL TO CREATE A PDS DATASET
//*******************************************************************************
//STEP001  EXEC PGM=IEFBR14
//DD1      DD DSN=RACFID.IBMMF.PDS1,
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(CYL,(10,100,4),RLSE),
//            DCB=(LRECL=80,BLKSIZE=800,RECFM=FB,DSORG=PO)
//*
//STEP002  EXEC PGM=IEFBR14
//DD2      DD DSN=RACFID.IBMMF.PDS2,
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(CYL,(10,100,4),RLSE),
//            DCB=(LRECL=80,BLKSIZE=800,RECFM=FB,DSORG=PO)
//*

4. JCL to delete a PDS dataset(s)

//RACFID04 JOB 4,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//*******************************************************************************
//* JCL TO DELETE A PDS DATASET
//*******************************************************************************
//STEP001  EXEC PGM=IEFBR14
//DD1      DD DSN=RACFID.IBMMF.PDS1,
//            DISP=(OLD,DELETE,DELETE)
//*
//STEP002  EXEC PGM=IEFBR14
//DD1      DD DSN=RACFID.IBMMF.PDS2,
//            DISP=(OLD,DELETE,DELETE)
//*

5. JCL to create a PDS dataset member(s)

//RACFID05 JOB 5,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//*******************************************************************************
//* JCL TO CREATE A PDS DATASET MEMBER
//*******************************************************************************
//STEP001  EXEC PGM=IEBGENER
//SYSUT1   DD *
//SYSUT2   DD DSN=RACFID.IBMMF.PDS(MEMBER1),
//            DISP=SHR
//SYSIN    DD DUMMY
//SYSPRINT DD SYSOUT=*
//*
//STEP002  EXEC PGM=IEBGENER
//SYSUT1   DD *
//SYSUT2   DD DSN=RACFID.IBMMF.PDS(MEMBER1),
//            DISP=SHR
//SYSIN    DD DUMMY
//SYSPRINT DD SYSOUT=*
//*

6. JCL to delete a PDS dataset member(s)

//RACFID06 JOB 6,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//*******************************************************************************
//* JCL TO DELETE A PDS DATASET MEMBER
//*******************************************************************************
//STEP001  EXEC PGM=IDCAMS
//DD1      DD  DSN=RACFID.IBMMF.PDS,
//             DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *
 DELETE 'RACFID.IBMMF.PDS(MEMBER1)' FILE(DD1)
/*
//STEP002  EXEC PGM=IDCAMS
//DD1      DD  DSN=RACFID.IBMMF.PDS,
//            DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *
  DELETE 'RACFID.IBMMF.PDS(MEMBER2)' FILE(DD1)
/*

7. JCL to create a GDG base(s)

//RACFID07 JOB 7,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//*******************************************************************************
//* JCL TO DELETE A PDS DATASET MEMBER
//*******************************************************************************
//STEP001  EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *
  DEFINE GDG(NAME(RACFID.IBMMF.BASE1) -
             LIMIT(7) -
             NOEMPTY -
             SCRATCH
/*
//STEP002  EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *
  DEFINE GDG(NAME(RACFID.IBMMF.BASE2) -
             LIMIT(7) -
             NOEMPTY -
             SCRATCH
/*

8. JCL to create a GDG generation(s)

//RACFID08 JOB 8,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//*******************************************************************************
//* JCL TO CREATE A GDG GENERATION
//*******************************************************************************
//STEP001  EXEC PGM=IEFBR14
//SYSPRINT DD SYSOUT=*
//DD1      DD DSN=RACFID.IBMMF.GDG(+1),
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(TRK,(100,100),RLSE),
//            DCB=(LRECL=80,RECFM=FB,BLKSIZE=800,DSORG=PS)
//*
//DD2      DD DSN=RACFID.IBMMF.GDG(+1),
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(TRK,(100,100),RLSE),
//            DCB=(LRECL=80,RECFM=FB,BLKSIZE=800,DSORG=PS)
//*

9. JCL to delete a GDG base(s)

//RACFID09 JOB 9,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//*******************************************************************************
//* JCL TO DELETE A GDG BASE
//*******************************************************************************
//STEP001  EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN    DD   *
  DELETE (RACFID.IBMMF.BASE1)    -
          GDG -
          FORCE
/*
//STEP002 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN    DD   *
  DELETE (RACFID.IBMMF.BASE2)    -
          GDG -
          FORCE
/*

10. JCL to delete one GDG generation(s)

//RACFID10 JOB 10,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO DELETE A ONE GDG GENERATION
//********************************************************************************
//STEP001  EXEC PGM=IEFBR14
//DD1      DD DSN=RACFID.IBMMF.BASE1.G0001V00,
//            DISP=(OLD,DELETE,DELETE)
//*
//DD2      DD DSN=RACFID.IBMMF.BASE2.G0001V00,
//            DISP=(OLD,DELETE,DELETE)

11. JCL to delete all GDG generation(s)

//RACFID11 JOB 11,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO DELETE A ONE GDG GENERATION
//********************************************************************************
//STEP001  EXEC PGM=IEFBR14
//DD1      DD DSN=RACFID.IBMMF.BASE1,
//            DISP=(OLD,DELETE,DELETE)
//*
//DD2      DD DSN=RACFID.IBMMF.BASE2,
//            DISP=(OLD,DELETE,DELETE)

12. JCL to create a VSAM - ESDS

//RACFID12 JOB 12,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO CREATE a VSAM - ESDS
//********************************************************************************
//STEP001  EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *
   DEFINE CLUSTER ( -
          NAME(RACFID.IBMMF.ESDS) -
          NONINDEXED -
          RECSZ(200 200) -
          FREESPACE(10 10) -
          CISZ(8192) -
          TRACKS(20 20) -
          VOLUME(IBMSYS)
/*

13. JCL to create a VSAM - KSDS

//RACFID13 JOB 13,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO CREATE a VSAM - KSDS
//********************************************************************************
//STEP001  EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *
  DEFINE CLUSTER( -
         NAME(RACFID.IBMMF.KSDS) -
         INDEXED -
         KEYS(5 0) -
         RECSZ(200 200) -
         FREESPACE(10 20) -
         TRACKS(50 30) -
         CISZ(4096) -
         VOLUME(IBMSYS))
/*

14. JCL to create a VSAM - RRDS

//RACFID14 JOB 14,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO CREATE a VSAM - RRDS
//********************************************************************************
//STEP001  EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *
   DEFINE CLUSTER ( -
   NAME(RACFID.IBMMF.RRDS) -
   NUMBERED -
   RECSZ(200 200) -
   CISZ(4096) -
   TRACKS(20 20) -
   FREESPACE(10 10) -
   VOLUME(IBMSYS))
/*

15. JCL to create a VSAM - LDS

//RACFID15 JOB 15,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO CREATE a VSAM - LDS
//********************************************************************************
//STEP001  EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *
  DEFINE CLUSTER ( -
  NAME(RACFID.IBMMF.LDS) -
  LINEAR -
  CISZ(4096) -
  TRACKS(20 20) -
  VOLUME(IBMSYS)
/*

16. JCL to LISTCAT a VSAM

//RACFID16 JOB 16,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO LISTCAT A VSAM
//********************************************************************************
//STEP001  EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *
  LISTCAT ENTRY(RACFID.IBMMF.ESDS) -
  ALL
/*

17. JCL REPRO – Copy from PS to ESDS

//RACFID17 JOB 17,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL REPRO – COPY FROM PS TO ESDS
//********************************************************************************
//STEP001  EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//*
//PSFILE   DD DSN=RACFID.IBMMF.PS,
//            DISP=SHR
//ESDSFILE DD DSN=RACFID.IBMMF.ESDS,
//            DISP=SHR
//SYSIN    DD *
   REPRO INFILE(PSFILE) -
         OUTFILE(ESDSFILE)
/*

18. JCL REPRO - Copy from PS TO KSDS

//RACFID18 JOB 18,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL REPRO - COPY FROM PS TO KSDS
//********************************************************************************
//STEP001  EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//*
//PSFILE   DD DSN=RACFID.IBMMF.PS,
//            DISP=SHR
//KSDSFILE DD DSN=RACFID.IBMMF.KSDS,
//            DISP=SHR
//SYSIN DD *
  REPRO INFILE(PSFILE) -
        OUTFILE(KSDSFILE)
/*

19. JCL REPRO - Copy from KSDS TO PS

//RACFID19 JOB 19,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL REPRO - COPY FROM KSDS TO PS
//********************************************************************************
//STEP001  EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//*
//KSFILE   DD DSN=RACFID.IBMMF.KSDS,
//            DISP=SHR
//PSFILE   DD DSN=RACFID.IBMMF.PS,
//            DISP=SHR
//*
//SYSIN DD *
  REPRO INFILE(KSFILE) -
        OUTFILE(PSFILE)
/*

20. JCL REPRO - copy from PS to RRDS

//RACFID20 JOB 20,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL REPRO - COPY FROM PS TO RRDS
//********************************************************************************
//STEP001  EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//*
//PSFILE   DD DSN=RACFID.IBMMF.PS,
//            DISP=SHR
//RRDSFILE DD DSN=RACFID.IBMMF.RRDS,
//            DISP=SHR
//*
//SYSIN DD *
  REPRO INFILE(PSFILE) -
        OUTFILE(RRDSFILE)
/*

21. JCL REPRO – copy from ESDS to ESDS

//RACFID21 JOB 21,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL REPRO - COPY FROM ESDS TO ESDS
//********************************************************************************
//STEP001  EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//*
//ESDS1    DD DSN=RACFID.IBMMF.ESDS1,
//            DISP=SHR
//ESDS2    DD DSN=RACFID.IBMMF.ESDS2,
//            DISP=SHR
//*
//SYSIN DD *
  REPRO INFILE(ESDS1) -
        OUTFILE(ESDS2)
/*

22. JCL REPRO – copy from RRDS to RRDS

//RACFID22 JOB 22,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL REPRO - COPY FROM RRDS TO RRDS
//********************************************************************************
//STEP001  EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//*
//RRDS1    DD DSN=RECFID.IBMMF.RRDS1,
//            DISP=SHR
//RRDS2    DD DSN=RECFID.IBMMF.RRDS2,
//            DISP=SHR
//*
//SYSIN DD *
   REPRO INFILE(RRDS1) -
         OUTFILE(RRDS2)
/*

23. JCL to copy all member from one PDS to another PDS

//RACFID23 JOB 23,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO COPY ALL MEMBER FROM ONE PDS TO ANOTHER PDS
//********************************************************************************
//STEP001  EXEC PGM=IEBCOPY
//DD1      DD DSN=RACFID.IBMMF.PDS1,DISP=SHR <--- INPUT DATASET
//DD2      DD DSN=RACFID.IBMMF.PDS2,DISP=SHR <--- OUTPUT DATASET
//*
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  COPY INDD=DD1
      OUTDD=DD2
/*

24. JCL to copy all member from one PDS to another PDS using SYSUT

//RACFID24 JOB 24,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO COPY ALL MEMBER FROM ONE PDS TO ANOTHER PDS USING SYSUT
//********************************************************************************
//STEP001  EXEC PGM=IEBCOPY
//SYSUT1   DD DSN=RACFID.IBMMF.PDS1,DISP=SHR <--- INPUT DATASET
//SYSUT2   DD DSN=RACFID.IBMMF.PDS2,DISP=SHR <--- OUTPUT DATASET
//*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD DUMMY

25. JCL to copy specific member from one PDS to another PDS

//RACFID25 JOB 25,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO COPY SPECIFIC MEMBER FROM ONE PDS TO ANOTHER PDS
//********************************************************************************
//STEP001  EXEC PGM=IEBCOPY
//DD1      DD DSN=RACFID.IBMMF.PDS1,DISP=SHR <--- INPUT DATASET
//DD2      DD DSN=RACFID.IBMMF.PDS2,DISP=SHR <--- OUTPUT DATASET
//*
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  COPY INDD=DD1
      OUTDD=DD2
    SELECT MEMBER=(MEMBER8,MEMBER3,MEMBER4)
/*

26. JCL to copy two PDS member to one PDS

//RACFID26 JOB 26,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO COPY TWO PDS MEMBER TO ONE PDS
//********************************************************************************
//STEP001  EXEC PGM=IEBCOPY
//DD1      DD DSN=RACFID.IBMMF.PDS1,DISP=SHR <--- INPUT DATASET
//DD2      DD DSN=RACFID.IBMMF.PDS2,DISP=SHR <--- INPUT DATASET
//DD3      DD DSN=RACFID.IBMMF.PDS3,DISP=SHR <--- OUTPUT DATASET
//*
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  COPY INDD=DD1
       INDD=DD2
      OUTDD=DD3
/*

27. JCL to copy specific member from two PDS to one PDS

//RACFID27 JOB 27,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO COPY SPECIFIC MEMBER FROM TWO PDS TO ONE PDS
//********************************************************************************
//STEP001  EXEC PGM=IEBCOPY
//DD1      DD DSN=RACFID.IBMMF.PDS1,DISP=SHR <--- INPUT DATASET
//DD2      DD DSN=RACFID.IBMMF.PDS2,DISP=SHR <--- INPUT DATASET
//DD3      DD DSN=RACFID.IBMMF.PDS3,DISP=SHR <--- OUTPUT DATASET
//*
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN DD *
  COPY INDD=DD1
       INDD=DD2
      OUTDD=DD3
      SELECT MEMBER=(MEMBER1,MEMBER5,MEMBER9)
/*

28. JCL to rename member while copying PDS to PDS

//RACFID28 JOB 28,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO RENAME MEMBER WHILE COPYING PDS TO PDS
//********************************************************************************
//STEP001  EXEC PGM=IEBCOPY
//DD1      DD DSN=RACFID.IBMMF.PDS1,DISP=SHR <-- INPUT DATASET
//DD2      DD DSN=RACFID.IBMMF.PDS2,DISP=SHR <-- INPUT DATASET
//DD3      DD DSN=RACFID.IBMMF.PDS3,DISP=SHR <-- OUTPUT DATASET
//*
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN DD *
  COPY INDD=DD1
       INDD=DD2
      OUTDD=DD3
  SELECT MEMBER=((MEMBER1,NEW1),MEMBER2)
/*

29. JCL to replace member while copying PDS to PDS

//RACFID29 JOB 29,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO REPLACE MEMBER WHILE COPYING PDS TO PDS
//********************************************************************************
//STEP001  EXEC PGM=IEBCOPY
//DD1      DD DSN=RACFID.IBMMF.PDS1,DISP=SHR <-- INPUT DATASET
//DD2      DD DSN=RACFID.IBMMF.PDS2,DISP=SHR <-- INPUT DATASET
//DD3      DD DSN=RACFID.IBMMF.PDS3,DISP=SHR <-- OUTPUT DATASET
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  COPY INDD=DD1
       INDD=DD2
      OUTDD=DD3
    SELECT MEMBER=((MEMBER2,,R))
/*

30. JCL to exclude/omit members while copying PDS to PDS

//RACFID30 JOB 30,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO EXCLUDE/OMIT MEMBERS WHILE COPYING PDS TO PDS
//********************************************************************************
//STEP001  EXEC PGM=IEBCOPY
//DD1      DD DSN=RACFID.IBMMF.PDS1,DISP=SHR <-- INPUT DATASET
//DD2      DD DSN=RACFID.IBMMF.PDS2,DISP=SHR <-- OUTPUT DATASET
//*
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  COPY INDD=DD1
      OUTDD=DD2
  EXCLUDE MEMBER=(MEMBER6,MEMBER3)
/*

31. JCL to rename and replace while copying PDS to PDS

//RACFID31 JOB 31,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO RENAME AND REPLACE WHILE COPYING PDS TO PDS
//********************************************************************************
//STEP001  EXEC PGM=IEBCOPY
//DD1      DD DSN=RACFID.IBMMF.PDS1,DISP=SHR <-- INPUT DATASET
//DD2      DD DSN=RACFID.IBMMF.PDS2,DISP=SHR <-- OUTPUT DATASET
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  COPY INDD=DD1
      OUTDD=DD2
  SELECT MEMBER=((MEMBER1,MEMBER2,R))
/*

32. JCL to compare PS datasets

//RACFID32 JOB 32,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO COMPARE PS DATASETS
//********************************************************************************
//STEP001  EXEC PGM=IEBCOMPR
//SYSUT1   DD DSN=RACFID.IBMMF.PS1,DISP=SHR <--- DATASETS TO COMPARE
//SYSUT2   DD DSN=RACFID.IBMMF.PS2,DISP=SHR <--- DATASETS TO COMPARE
//*
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  COMPARE TYPORG=PS
/*

33. JCL to compare PDS datasets

//RACFID33 JOB 33,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO COMPARE PDS DATASETS
//********************************************************************************
//STEP001  EXEC PGM=IEBCOMPR
//SYSUT1   DD DSN=RACFID.IBMMF.PDS1,DISP=SHR <--- DATASETS TO COMPARE
//SYSUT2   DD DSN=RACFID.IBMMF.PDS2,DISP=SHR <--- DATASETS TO COMPARE
//*
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  COMPARE TYPORG=PO
/*

34. JCL to Copy whole job into another dataset

//RACFID34 JOB 34,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO COPY WHOLE JOB INTO ANOTHER DATASET
//********************************************************************************
//STEP001  EXEC PGM=IEBEDIT
//SYSUT1   DD DSN=RACFID.IBMMF.PS1,DISP=SHR
//SYSUT2   DD DSN=RACFID.IBMMF.PS2,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  EDIT START=COPY1
/*

35. JCL to Copy multiple job into another dataset

//RACFID35 JOB 35,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO COPY MULTIPLE JOB INTO ANOTHER DATASET
//********************************************************************************
//STEP001  EXEC PGM=IEBEDIT
//SYSUT1   DD DSN=RACFID.IBMMF.PS1,DISP=SHR
//SYSUT2   DD DSN=RACFID.IBMMF.PS2,DISP=SHR
//*
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  EDIT START=COPY1
  EDIT START=COPY2
/*

36. JCL to Copy steps using INCLUDE and EXCLUDE command

//RACFID36 JOB 36,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO COPY STEPS USING INCLUDE and EXCLUDE command
//********************************************************************************
//STEP001  EXEC PGM=IEBEDIT
//SYSUT1   DD DSN=RACFID.IBMMF.PS1,DISP=SHR
//SYSUT2   DD DSN=RACFID.IBMMF.PS2,DISP=SHR
//*
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  EDIT START=COPY1,TYPE=EXCLUDE,STEPNAME=STEPB
  EDIT START=COPY2,TYPE=INCLUDE,STEPNAME=STEPA
/*

37. JCL to Copy steps using POSITION member

//RACFID37 JOB 37,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO COPY STEPS USINF POSITION MEMBER
//********************************************************************************
//STEP001  EXEC PGM=IEBEDIT
//SYSUT1   DD DSN=RACFID.IBMMF.PS1,DISP=SHR
//SYSUT2   DD DSN=RACFID.IBMMF.PS2,DISP=SHR
//*
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  EDIT START=COPY1,TYPE=POSITION,STEPNAME=STEPC
/*

38. JCL to Merge Datasets

//RACFID38 JOB 38,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO MERGE DATASETS
//********************************************************************************
//STEP001  EXEC PGM=IEBCOPY
//DD1      DD DSN=RACFID.IBMMF.PDS1,DISP=SHR <-- INPUT DATASET
//DD2      DD DSN=RACFID.IBMMF.PDS2,DISP=SHR <-- INPUT DATASET
//DD3      DD DSN=RACFID.IBMMF.PDS3,DISP=SHR <-- OUTPUT DATASET
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
   COPY OUTDD=DD3
   INDD=DD1
   INDD=DD2
/*

39. JCL to Compress a PDS

//RACFID39 JOB 39,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO COMPRESS A PDS
//********************************************************************************
//STEP001  EXEC PGM=IEBCOPY
//DD1      DD DSN=RACFID.IBMMF.PDS,DISP=SHR <-- DATASET TO COMPRESS
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  COPY INDD=DD1
      OUTDD=DD1
/*

40. JCL to List a PDS

//RACFID40 JOB 40,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO LIST A PDS
//********************************************************************************
//STEP001  EXEC PGM=IEHLIST
//DD1      DD UNIT=DISK,VOLUME=SER=IBMMFVOL,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  LISTPDS DSNAME=RACFID.IBMMF.PDS,
          VOLUME=DISK=IBMMFVOL
/*

41. JCL to List a VTOC

//RACFID41 JOB 41,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO LIST A VTOC
//********************************************************************************
//STEP001  EXEC PGM=IEHLIST
//DD1      DD UNIT=DISK,VOLUME=SER=IBMMFVOL,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  LISTVTOC FORMAT,
          VOLUME=DISK=IBMMFVOL
/*

42. JCL to SCRATCH a dataset

//RACFID42 JOB 42,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO SCRATCH A DATASET
//********************************************************************************
//STEP001  EXEC PGM=IEHPROGM
//DD1      DD UNIT=DISK,VOLUME=SER=IBMMFVOL,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  SCRATCH DSNAME=RACFID.IBMMF.PS,VOL=DISK=IBMMFVOL
/*

43. JCL to UNCATALOG a dataset

//RACFID43 JOB 43,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO UNCATALOG a dataset
//********************************************************************************
//STEP001  EXEC PGM=IEHPROGM
//DD1      DD UNIT=DISK,VOLUME=SER=IBMMFVOL,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  UNCATLG DSNAME=RACFID.IBMMF.PS
/*

44. JCL to sort a single field

//RACFID44 JOB 44,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO SORT A SINGLE FIELD
//********************************************************************************
//STEP001  EXEC PGM=SORT
//SORTIN   DD DSN=RACFID.IBMMF.INPUT,
//            DISP=SHR
//SORTOUT  DD DSN=RACFID.IBMMF.OUTPUT,
//            DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  SORT FIELDS=(1,10,CH,A)
/*

45. JCL to sort multiple fields

//RACFID45 JOB 45,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO SORT A MULTIPLE FIELD
//********************************************************************************
//STEP001  EXEC PGM=SORT
//SORTIN   DD DSN=RACFID.IBMMF.INPUT,
//            DISP=SHR
//SORTOUT  DD DSN=RACFID.IBMMF.OUTPUT,
//            DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  SORT FIELDS=(1,10,CH,A,30,5,CH,D)
/*

46. JCL to SORT multiple fields using FORMAT keyword

//RACFID46 JOB 46,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO SORT MULTIPLE FIELDS USING FORMAT KEYWORD
//********************************************************************************
//STEP001  EXEC PGM=SORT
//SORTIN   DD DSN=RACFID.IBMMF.INPUT,
//            DISP=SHR
//SORTOUT  DD DSN=RACFID.IBMMF.OUTPUT,
//            DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  SORT FORMAT=CH,FIELDS=(1,10,D,30,5,D)
/*

47. JCL to sort record in ascending order

//RACFID47 JOB 47,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO SORT RECORD IN ASSCENDING ORDER
//********************************************************************************
//STEP001  EXEC PGM=SORT
//SORTIN   DD DSN=RACFID.IBMMF.INPUT,
//            DISP=SHR
//SORTOUT  DD DSN=RACFID.IBMMF.OUTPUT,
//            DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  SORT FIELDS=(1,10,CH,A)
/*

48. JCL to sort record in descending order

//RACFID48 JOB 48,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO SORT RECORD IN DESCENDING ORDER
//********************************************************************************
//STEP001  EXEC PGM=SORT
//SORTIN   DD DSN=RACFID.IBMMF.INPUT,
//            DISP=SHR
//SORTOUT  DD DSN=RACFID.IBMMF.OUTPUT,
//            DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  SORT FIELDS=(40,5,CH,D)
/*

49. JCL to copy a dataset using SORT

//RACFID49 JOB 49,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO COPY A DATASET USING SORT
//********************************************************************************
//STEP001  EXEC PGM=SORT
//SORTIN   DD DSN=RACFID.IBMMF.INPUT,
//            DISP=SHR
//SORTOUT  DD DSN=RACFID.IBMMF.OUTPUT,
//            DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  OPTION COPY
/*

50. JCL to sort the record with INCLUDE condition

//RACFID40 JOB 40,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO SORT THE RECORD WITH INCLUDE CONDITION
//********************************************************************************
//STEP001  EXEC PGM=SORT
//SORTIN   DD DSN=RACFID.IBMMF.INPUT,
//            DISP=SHR
//SORTOUT  DD DSN=RACFID.IBMMF.OUTPUT,
//            DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  SORT FIELDS=(1,10,CH,A)
  INCLUDE COND=(20,5,CH,EQ,C'IBMMF')
/*

51. JCL to sort the record with INCLUDE many condition

//RACFID51 JOB 51,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO SORT THE RECORD WITH INCLUDE MANY CONDITION
//********************************************************************************
//STEP001  EXEC PGM=SORT
//SORTIN   DD DSN=RACFID.IBMMF.INPUT,
//            DISP=SHR
//SORTOUT  DD DSN=RACFID.IBMMF.OUTPUT,
//            DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  SORT FIELDS=(1,10,CH,A)
  INCLUDE COND=(25,4,CH,EQ,C'2020',OR,50,1,CH,NE,C'F')
/*

52. JCL to sort the record with omit condition

//RACFID52 JOB 52,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO SORT THE RECORD WITH OMIT CONDITION
//********************************************************************************
//STEP001  EXEC PGM=SORT
//SORTIN   DD DSN=RACFID.IBMMF.INPUT,
//            DISP=SHR
//SORTOUT  DD DSN=RACFID.IBMMF.OUTPUT,
//            DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  SORT FIELDS=(1,10,CH,A)
  INCLUDE COND=(1,2,CH,EQ,C'NY',OR,1,2,CH,EQ,C'NJ')
/*

53. JCL to sort the record with OUTREC field

//RACFID53 JOB 53,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO SORT THE RECORD WITH OUTREC FIELDS
//********************************************************************************
//STEP001  EXEC PGM=SORT
//SORTIN   DD DSN=RACFID.IBMMF.INPUT,
//            DISP=SHR
//SORTOUT  DD DSN=RACFID.IBMMF.OUTPUT,
//            DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  SORT FIELDS=(10,4,BI,D)
  OUTREC FIELDS=(1,20,30,50)
/*

54. JCL to copy a dataset using SORT OUTREC with FINDREP

//RACFID54 JOB 54,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO COPY A DATASET USING SORT OUTREC WITH FINDREP
//********************************************************************************
//STEP001  EXEC PGM=SORT
//SORTIN   DD DSN=RACFID.IBMMF.INPUT,
//            DISP=SHR
//SORTOUT  DD DSN=RACFID.IBMMF.OUTPUT,
//            DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  OPTION COPY
  OUTREC FINDREP=(IN=C'MAINFRAME TUTORIAL',OUT=C'IBMMAINFRAMER')
/*

55. JCL to sort the record and write OUTREC at specific columns

//RACFID55 JOB 55,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO SORT THE RECORD AND WRITE OUTREC AT SPECIFIC COLUMNS
//********************************************************************************
//STEP001  EXEC PGM=SORT
//SORTIN   DD DSN=RACFID.IBMMF.INPUT,
//            DISP=SHR
//SORTOUT  DD DSN=RACFID.IBMMF.OUTPUT,
//            DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  SORT FIELDS=(1,4,BI,A)
  OUTREC BUILD=(20:2,4,30:10,70)
/*

56. JCL to SPLIT file record based on condition

//RACFID56 JOB 56,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO SPLIT FILE RECORD BASED ON CONDITION
//********************************************************************************
//STEP001  EXEC PGM=SORT
//SORTIN   DD DSN=RACFID.IBMMF.INPUT,DISP=SHR
//SORTOF01 DD DSN=RACFID.IBMMF.NY,DISP=SHR
//SORTOF02 DD DSN=RACFID.IBMMF.PL,DISP=SHR
//SORTOF03 DD DSN=RACFID.IBMMF.NJ.DISP=SHR
//*
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  OPTION COPY
  OUTFIL FILES=01,INCLUDE=(23,2,CH,EQ,C'NY')
  OUTFIL FILES=02,INCLUDE=(23,2,CH,EQ,C'PL')
  OUTFIL FILES=03,INCLUDE=(23,2,CH,EQ,C'NJ')
/*

57. JCL to SPLIT a dataset into equal parts

//RACFID57 JOB 57,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO SPLIT A DATASET INTO EQUAL PARTS
//********************************************************************************
//STEP001  EXEC PGM=SORT
//SORTIN   DD DSN=RACFID.IBMMF.INPUT,DISP=SHR
//SORTOF01 DD DSN=RACFID.IBMMF.OUTPUT1,DISP=SHR
//SORTOF02 DD DSN=RACFID.IBMMF.OUTPUT2,DISP=SHR
//*
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  OPTION COPY
  OUTFIL FILES=(01,02),SPLIT
/*

58. JCL to SORT for Multiple copies using OUTFIL

//RACFID58 JOB 58,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL SORT FOR MULTIPLE COPIES USING OUTFIL
//********************************************************************************
//STEP001  EXEC PGM=SORT
//SORTIN   DD DSN=RACFID.IBMMF.INPUT,DISP=SHR
//SORTOF01 DD DSN=RACFID.IBMMF.OUT1,DISP=SHR
//SORTOF02 DD DSN=RACFID.IBMMF.OUT2,DISP=SHR
//SORTOF03 DD DSN=RACFID.IBMMF.OUT3.DISP=SHR
//*
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  OPTION COPY
  OUTFIL FILES=(01,02,03)
/*

59. JCL to remove duplicate record from dataset

//RACFID59 JOB 59,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO REMOVE DUPLICATE RECORD FROM DATASET
//********************************************************************************
//STEP001  EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=RACFID.IBMMF.INPUT,DISP=SHR
//SORTOUT  DD DSN=RACFID.IBMMF.OUTPUT,DISP=SHR
//SYSIN    DD *
  SORT FIELDS=(1,15,ZD,A)
  SUM FIELDS=NONE
/*

60. JCL to COPY only first 100 records in dataset

//RACFID60 JOB 60,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO Copy ONLY FIRST 100 RECORDS IN DATASET
//********************************************************************************
//STEP001 EXEC PGM=SORT
//SYSOUT  DD SYSOUT=*
//SORTIN  DD DSN=RECFID.IBMMF.INPUT,DISP=SHR
//SORTOUT DD DSN=RACFID.IBMMF.OUTPUT,DISP=SHR
//SYSIN   DD *
  OPTION COPY,STOPAFT=50
/*

61. JCL to Overwrite input record content

//RACFID61 JOB 61,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO OVERWRITE INPUT RECORD CONTENT
//********************************************************************************
//STEP001 EXEC PGM=SORT
//SYSOUT  DD SYSOUT=*
//SORTIN  DD DSN=RECFID.IBMMF.INPUT,DISP=SHR
//SORTOUT DD DSN=RACFID.IBMMF.OUTPUT,DISP=SHR
//SYSIN   DD *
  OPTION COPY
  INREC OVERLAY=(47:1,6)
/*

62. JCL SORT IF condition

//RACFID61 JOB 61,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL SORT IF CONDITION
//********************************************************************************
//STEP001  EXEC PGM=SORT
//SORTIN   DD *
123456789012345 ---> Column
HEADRselect
DETAL
TRIALselect
/*
//SORTOUT  DD DSN=RACFID.IBMMF.OUTPUT,
//        DISP=(NEW,CATLG,DELETE),
//        DCB=*.SYSUT1,SPACE=(CYL,(50,1),RLSE)
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  INREC  IFTHEN=(WHEN=(6,1,CH,NE,C' '),BUILD=(1:1,15),
         IFTHEN=(WHEN=(6,1,CH,EQ,C' '),BUILD=(1:1,5,7:C'RECORD')
  OPTION COPY
/*

63. JCL to convert a FB dataset to VB

//RACFID63 JOB 63,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO CONVERT A FB DATASET TO VB
//********************************************************************************
//STEP001  EXEC  PGM=SORT
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DSN=RACFID.IBMMF.FBIN,DISP=SHR
//VBOUT    DD  DSN=RACFID.IBMMF.VBOUT,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=3390,SPACE=(CYL,(5,5))
//SYSIN    DD  *
  OPTION COPY
  OUTFIL FNAMES=VBOUT,FTOV
/*

64. JCL to convert a VB dataset to FB

//RACFID64 JOB 64,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO CONVERT A VB DATASET TO FB
//********************************************************************************
//STEP001  EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=RACFID.IBMMF.VBIN,DISP=SHR   <-- LRECL=104
//FBOUT    DD DSN=RACFID.IBMMF.FBOUT,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=3390,SPACE=(CYL,(5,5))
//SYSIN    DD *
  OPTION COPY
  OUTFIL FNAMES=FBOUT,VTOF,OUTREC=(5,100)
/*

65. JCL to copy dataset using ICETOOL

//RACFID65 JOB 65,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL TO COPY DATASET USING ICETOOL
//********************************************************************************
//STEP001  EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//*
//INPUT   DD DSN=RACFID.IBMMF.INPUT,DISP=SHR
//OUTPUT  DD DSN=RACFID.IBMMF.OUTPUT,DISP=(NEW,CATLG),
//          DCB=(*.INPUT1)
//*
//TOOLIN  DD *
  COPY FROM(INPUT) TO(OUTPUT)
/*

66. JCL SORT - Omit Numeric Data

//RACFID66 JOB 66,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL SORT - OMIT NUMERIC DATA
//********************************************************************************
//STEP001  EXEC  PGM=SORT
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DSN=RACFID.IBMMF.INPUT,DISP=SHR
//SORTOUT  DD  DSN=RACFID.IBMMF.OUTPUT,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=3390,SPACE=(CYL,(5,5))
//SYSIN    DD  *
  OPTION COPY
  INCLUDE COND=(1,3,FS,NE,NUM)
/*
If the value in the field (1,3,FS) is not equal (NE) to numerics(NUM), those records will be included in output dataset.
The record in the output data set will be those in which the field has non-numerics(a character other than 0 to 9 somewhere in the field).

67. JCL SORT - Include Numeric Data

//RACFID66 JOB 67,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL SORT - INCLUDE NUMERIC DATA
//********************************************************************************
//STEP001  EXEC  PGM=SORT
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DSN=RACFID.IBMMF.INPUT,DISP=SHR
//SORTOUT  DD  DSN=RACFID.IBMMF.OUTPUT,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=3390,SPACE=(CYL,(5,5))
//SYSIN    DD  *
  OPTION COPY
  INCLUDE COND=(1,3,FS,EQ,NUM)
/*
If the value in the field (1,3,FS) is equal (EQ) to numerics(NUM), those records will be included in output dataset.

68. JCL SORT - Include Uppercase characters Data(A-Z)

//RACFID68 JOB 68,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL SORT - INCLUDE UPPERCASE CHARACTERS DATA (A-Z)
//********************************************************************************
//STEP001  EXEC  PGM=SORT
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DSN=RACFID.IBMMF.INPUT,DISP=SHR
//SORTOUT  DD  DSN=RACFID.IBMMF.OUTPUT,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=3390,SPACE=(CYL,(5,5))
//SYSIN    DD  *
  OPTION COPY
  INCLUDE COND=(5,10,BI,EQ,UC)
/*
INCLUDE statement includes records which have uppercase character(A-Z) in postions 5 to 15.

69. JCL SORT - Include lowercase characters Data(a-z)

//RACFID68 JOB 69,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL SORT - INCLUDE LOWERCASE CHARACTERS DATA (a-z)
//********************************************************************************
//STEP001  EXEC  PGM=SORT
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DSN=RACFID.IBMMF.INPUT,DISP=SHR
//SORTOUT  DD  DSN=RACFID.IBMMF.OUTPUT,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=3390,SPACE=(CYL,(5,5))
//SYSIN    DD  *
  OPTION COPY
  INCLUDE COND=(5,10,BI,EQ,LC)
/*
INCLUDE statement includes records which have lowercase characters(a-z) in postions 5 to 15.

70. JCL SORT - Include Both Uppercase and Lowercase characters Data(A-Z, a-z)

//RACFID68 JOB 70,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL SORT - INCLUDE UPPERCASE & LOWERCASE CHARACTERS DATA (A-Z, a-z)
//********************************************************************************
//STEP001  EXEC  PGM=SORT
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DSN=RACFID.IBMMF.INPUT,DISP=SHR
//SORTOUT  DD  DSN=RACFID.IBMMF.OUTPUT,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=3390,SPACE=(CYL,(5,5))
//SYSIN    DD  *
  OPTION COPY
  INCLUDE COND=(5,10,BI,EQ,MC)
/*
INCLUDE statement includes records which have uppercase and lowercase characters(A-Z, a-z) in postions 5 to 15.

71. JCL SORT - Include Uppercase and Numeric characters Data(A-Z, 0-9)

//RACFID68 JOB 71,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL SORT - INCLUDE UPPERCASE & NUMERIC CHARACTERS DATA (A-Z, 0-9)
//********************************************************************************
//STEP001  EXEC  PGM=SORT
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DSN=RACFID.IBMMF.INPUT,DISP=SHR
//SORTOUT  DD  DSN=RACFID.IBMMF.OUTPUT,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=3390,SPACE=(CYL,(5,5))
//SYSIN    DD  *
  OPTION COPY
  INCLUDE COND=(5,10,BI,EQ,UN)
/*
INCLUDE statement includes records which have uppercase and numeric characters(A-Z, 0-9) in postions 5 to 15.

72. JCL SORT - Include Lowercase and Numeric characters Data (a-z, 0-9)

//RACFID68 JOB 72,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL SORT - INCLUDE LOWERCASE AND NUMBERIC CHARACTERS DATA (a-z, 0-9)
//********************************************************************************
//STEP001  EXEC  PGM=SORT
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DSN=RACFID.IBMMF.INPUT,DISP=SHR
//SORTOUT  DD  DSN=RACFID.IBMMF.OUTPUT,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=3390,SPACE=(CYL,(5,5))
//SYSIN    DD  *
  OPTION COPY
  INCLUDE COND=(5,10,BI,EQ,LN)
/*
INCLUDE statement includes records which have lowercase and numeric characters(a-z, 0-9) in postions 5 to 15.

73. JCL SORT - Include Uppercase, Lowercase and Numeric characters Data (A-Z, a-z, 0-9)

//RACFID68 JOB 73,'IBMMAINFRAMER',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//********************************************************************************
//* JCL SORT - INCLUDE UPPERCASE, LOWERCASE AND NUMERIC CHARACTERS DATA (A-Z, a-z, 0-9)
//********************************************************************************
//STEP001  EXEC  PGM=SORT
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DSN=RACFID.IBMMF.INPUT,DISP=SHR
//SORTOUT  DD  DSN=RACFID.IBMMF.OUTPUT,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=3390,SPACE=(CYL,(5,5))
//SYSIN    DD  *
  OPTION COPY
  INCLUDE COND=(5,10,BI,EQ,MN)
/*
INCLUDE statement includes records which have uppercase, lowercase and numeric characters(A-Z, a-z, 0-9) in postions 5 to 15.