JCL Example Sample Reference code


Volta a página anterior

Volta ao Menu Principal


Desenvolvido por DORNELLES, Carlos Alberto - Analista de Sistemas - Brasília DF. - cad_cobol@hotmail.com

JCL Example Sample Reference code
  1. IEFBR14 - JCL to create a PS dataset(s)
  2. IEFBR14 - JCL to delete a PS dataset(s)
  3. IEFBR14 - JCL to create a PDS dataset(s)
  4. IEFBR14 - JCL to delete a PDS dataset(s)
  5. IEBGENER - JCL to create a PDS dataset member(s)
  6. IDCAMS - JCL to delete a PDS dataset member(s)
  7. IDCAMS - JCL to create a GDG base(s)
  8. IEFBR14 - JCL to create a GDG generation(s)
  9. IDCAMS - JCL to delete a GDG base & generations(s)
  10. IEFBR14 - JCL to delete one GDG generation(s)
  11. IEFBR14 - JCL to delete all GDG generation(s)
  12. IDCAMS - JCL to create a VSAM - ESDS
  13. IDCAMS - JCL to create a VSAM - KSDS
  14. IDCAMS - JCL to create a VSAM - RRDS
  15. IDCAMS - JCL to create a VSAM - LDS
  16. IDCAMS - JCL to LISTCAT a VSAM
  17. IDCAMS - JCL REPRO – copy from PS to ESDS
  18. IDCAMS - JCL REPRO – copy from PS to KSDS
  19. IDCAMS - JCL REPRO – copy from KSDS to PS
  20. IDCAMS - JCL REPRO – copy from PS to RRDS
  21. IDCAMS - JCL REPRO – copy from ESDS to ESDS
  22. IDCAMS - JCL REPRO – copy from RRDS to RRDS
  23. IEBCOPY - JCL to copy all member from one PDS to another
  24. IEBCOPY - JCL to copy all member from one PDS to another PDS using SYSUT
  25. IEBCOPY - JCL to copy specific member from one PDS to another PDS
  26. IEBCOPY - JCL to copy two PDS member to one PDS
  27. IEBCOPY - JCL to copy specific member from two PDS to one PDS
  28. IEBCOPY - JCL to rename member while copying PDS to PDS
  29. IEBCOPY - JCL to replace member while copying PDS to PDS
  30. IEBCOPY - JCL to exclude/omit members while copying PDS to PDS
  31. IEBCOPY - JCL to rename and replace while copying PDS to PDS
  32. IEBCOMPR - JCL to compare PS datasets
  33. IEBCOMPR - JCL to compare PDS datasets
  1. IEBEDIT - JCL to copy whole job into another dataset
  2. IEBEDIT - JCL to copy multiple job into another dataset
  3. IEBEDIT - JCL to copy steps using INCLUDE and EXCLUDE command
  4. IEBEDIT - JCL to copy steps using POSITION member
  5. IEBCOPY - JCL to merge Datasets
  6. IEBCOPY - JCL to compress a PDS
  7. IEHLIST - JCL to list a PDS
  8. IEHLIST - JCL to list a VTOC
  9. IEHPROGM - JCL to SCRATCH a dataset
  10. IEHPROGM - JCL to UNCATALOG a dataset
  11. SORT - JCL to SORT a single field
  12. SORT - JCL to SORT multiple fields
  13. SORT - JCL to SORT multiple fields using FORMAT keyword
  14. SORT - JCL to SORT record in ascending order
  15. SORT - JCL to SORT record in descending order
  16. SORT - JCL to copy a dataset using SORT
  17. SORT - JCL to SORT the record with INCLUDE condition
  18. SORT - JCL to SORT the record with INCLUDE many condition
  19. SORT - JCL to SORT the record with omit condition
  20. SORT - JCL to SORT the record with OUTREC field
  21. SORT - JCL to copy a dataset using SORT OUTREC with FINDREP
  22. SORT - JCL to SORT the record and write OUTREC at specific columns
  23. SORT - JCL to SPLIT file record based on condition
  24. SORT - JCL to SPLIT a dataset into equal parts
  25. SORT - JCL to SORT for Multiple copies using OUTFIL
  26. SORT - JCL to remove duplicate record from dataset
  27. SORT - JCL to COPY only first 100 records in dataset
  28. SORT - JCL to Overwrite input record content
  29. SORT - JCL to SORT with IF condition
  30. SORT - JCL to convert a FB data set to VB
  31. SORT - JCL to convert a VB data set to FB
  32. ICETOOL - JCL To Copy Dataset Using ICETOOL


1. JCL to create a PS dataset(s) - Início

//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) - Início

//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) - Início

//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) - Início

//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) - Início

//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) - Início

//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) - Início

//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) - Início

//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) - Início

//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) - Início

//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) - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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 - Início

//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)
/*

© Copyright IBMMAINFRAMER