JCL Session 4


IEBGENER - makes a copy of the input.

//JPETLICJ JOB 01,'BIN-NUMBER MYNAME',MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=JPETLIC
//******************************************************************
//* IEBGENER used without formatting directions
//******************************************************************
//STEPA EXEC PGM=IEBGENER
//SYSUT1 DD DSN=JPETLIC.CSC.CNTL(GRADES),DISP=SHR
//SYSUT2 DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY

DD - Connects program input/output to data.

Input can come from a file (dataset) or instream data (part of the JCL stream)
Output can go to a file (dataset) or print queue (Usually sent to some kind of printer or HOLD queue)


SAMPLE INPUT DD STATEMENTS:
When Input is a catalogued file

//SYSUT1 DD DSN=CCPM44.SERIES,DISP=SHR

-------------------------------------------------------------------------------------------------------------------------------

When Input is a member of a catalogued PDS

// SYSUT1 DD DSN=CCPM53.CSC.CNTL(GARBAGE),DISP=SHR

-------------------------------------------------------------------------------------------------------------------------------

When Input is instream data (in JCL input stream)

// SYSUT1 DD * input data follows immediately after this card
1234
5678
9938
/*

-------------------------------------------------------------------------------------------------------------------------------

Can //ANY DD be used to give input to IEBGENER?
 


SAMPLE OUTPUT DD STATEMENTS:
Output is to a catalogued sequential file

//SYSUT2 DD DSN=CCPM44.SERIES,DISP=OLD

-------------------------------------------------------------------------------------------------------------------------------

Output is to a file member of a catalogued PDS

//SYSUT2 DD DSN=CCPM53.CSC.CNTL(NEWSTUFF),DISP=OLD

-------------------------------------------------------------------------------------------------------------------------------

Output to a print queue

//SYSUT2 DD SYSOUT=X < X - HELD OUTPUT QUEUE

------------------------------------------------------------------------------------------------------------------------------

Can //ANY be used to route output from IEBGENER?

-------------------------------------------------------------------------------------------------------------------------------
 


MORE ABOUT INPUT DD STATEMENTS DISP PARAMETERS


If the program reading the data is successful, should the system If the program reading the data fails (abends), should the system
DISP STATEMENTS for READING catalogued DATA SETS:


Required DD parameters if data is a catalogued file
 

IEFBR14 - program does not read or write but is used for DISP= processing



MORE ABOUT OUTPUT DD STATEMENTS


If the program creating data is successful, should the system If the program creating data fails (abends), should the system
DD parameters for output data written to a file //ddname DD DSN=dataset name,DISP=(start_status, normal_end, abend),UNIT=unit,
// SPACE=(units,(primary,secondary,directory_amt),RLSE,CONTIG),
// DCB=(RECFM=record_fmt,LRECL=record_length,BLKSIZE=blocking_factor)


The DD parameters needed for writing to datasets depends on whether the
DD parameters for output data written to a file


DSN         - Data set name

DISP         - start_status - always exclusive use

  OLD     - dataset already exists
            - system will over-write records on the existing file
              (Members within a PDS are not controlled individually by DISP)

NEW    - dataset does not exist
            - system will write at the next available space

MOD     - dataset may or may not exist
            - If dataset is new, system will start at the next available space
            - If dataset exists, new records will be put at the end of the existing file.

normal_end -
CATLG           - Catalogue when step ends
DELETE         - Erase from catalogue and VTOC
PASS            - Give location of dataset to next job steps
KEEP            - Put in VTOC

- abend
CATLG           - Catalogue when step ends
DELETE         - Erase from catalogue and VTOC
KEEP            - Retain but do not catalogue.

SPACE         - used for disk datasets UNIT=SYSDA requires an estimate of how much
                      disk space is needed DCB             - describes characteristics of the datasets you want to read or write.
 

IEFBR14 - program does not read or write but is used for DISP= processing

//STEPNAME EXEC PGM=IEFBR14
//ANYNAME DD DSN=CCPH00.CSC.TEST,DISP=(NEW,CATLG),
// UNIT=SYSDA,SPACE=(TRK,1),
// DCB=(BLKSIZE=4000,LRECL=80,RECFM=FB)



OUTPUT JCL STATEMENT -- Can specify identical SYSOUT parameters for
multiple DD statements pointing to print queues (SYSOUT=) and can send
one report to multiple locations.

If all the SYSOUT references in a JOB are to use the same parameters, code
them once on an OUTPUT statement and place the OUTPUT statement
between the JOB and first EXEC statement.

Some special OUTPUT parameters
 



Example of implicit referencing JOB or EXEC step level:

//JPETLICJ JOB 01,'BIN MYNAME',MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=JPETLIC
//JOBDFLT OUTPUT DEFAULT=YES,JESDS=ALL,COPIES=2,DEST=AC
//*
//STEPA  EXEC PGM=IEBGENER
//SYSUT1   DD DSN=JPETLIC.CSC.CNTL(GARBAGE),DISP=SHR
//SYSUT2   DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN    DD DUMMY
//*
//STEPB  EXEC PGM=IEBGENER
//STEPDFLT OUTPUT DEFAULT=YES,COPIES=3,DEST=LPC
//SYSUT1   DD DSN=JPETLIC.CSC.CNTL(GRADES),DISP=SHR
//SYSUT2   DD SYSOUT=D
//SYSPRINT DD SYSOUT=D
//SYSIN    DD DUMMY



Example of explicit referencing JOB or EXEC step level -- OUTPUT PARAMETER:

//JPETLICJ JOB 01,'BIN MYNAME',MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=JPETLIC
//STANDARD OUTPUT DEFAULT=YES,COPIES=2,DEST=AC,JESDS=ALL
//STEPA   EXEC PGM=IEBGENER
//LOOP    OUTPUT DEST=AC,CLASS=D,COPIES=2
//LPARK   OUTPUT DEST=LPC,CLASS=X
//SYSUT1   DD DSN=JPETLIC.CSC.CNTL(GARBAGE),DISP=SHR
//SYSUT2   DD SYSOUT=(,),OUTPUT=(*.LOOP,*.LPARK)
//SYSPRINT DD SYSOUT=*
//SYSIN    DD DUMMY



IEBCOPY         Can be used to copy, compress or combine entire PDS's
                        or SELECTED members or copy and skip EXCLUDED
                        members to another PDS dataset.
                        BACKUP AND RESTORE USE IEBCOPY



//stepname  EXEC PGM=IEBCOPY
//SYSIN       DD input IEBCOPY control statement
//SYSUT1      DD input PDS dataset that is to be copied using //SYSIN DD DUMMY
//*              or one or more INDD DD statements
//in          DD input PDS dataset with //SYSIN referring to INDD=in
//SYSUT2      DD output PDS dataset created using //SYSIN DD DUMMY
//*              or an OUTDD DD statement
//out         DD output PDS dataset with //SYSIN referring to OUTDD=out
//SYSPRINT    DD output message listing
//* To copy everything from one PDS to another, use
//* //SYSUT1 DD and //SYSUT2 DD and //SYSIN DD DUMMY.
//*
//* Use the SELECT statement to name members that you want to copy.
//*
//* The member name format is (input_name,output_name,R) where R means replace if exists.
//* SELECT MEMBER=(mem1,(mem2,,r),(member3,rename3),(mem4,ren4,r))
//*
//* Use the EXCLUDE statement to name members that you want to avoid copying.
//*
//* Use EXCLUDE statement to copy everything expect named members, ie.
//* EXCLUDE MEMBER=(grades4,salsurv,junk)

IEBCOPY Example


//********************************************************************************************
//* Copy four members of JPETLIC.CSC.COBOL to JPETLIC.CSC.COBOLBAK
//********************************************************************************************
//STEP2 EXEC PGM=IEBCOPY
//IN DD DSN=JPETLIC.CSC.COBOL,DISP=OLD
//OUT DD DSN=JPETLIC. CSC.COBOLBAK,DISP=OLD
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
  COPY INDD=IN,OUTDD=OUT <-- identify input and output ddnames
  SELECT MEMBER=(PROG1,(PROG2NEW,PROGXX),(PROG3NEW,PROG3,R),(PROG4,,R))
//*
//********************************************************************************************
//* COPY statement specifies ddname IN for input by INDD=IN
//* COPY statement specifies ddname OUT for output by OUTDD=OUT
//* members will be copied from IN to OUT pds datasets
//*
//* IN PDS DATASET OUT PDS DATASET
//* JPETLIC.CSC.COBOL JPETLIC.CSC.COBOLBAK
//* ************************** *********************************
//* PROG1 ----- > PROG1 (becomes new member PROG1)
//* PROG2NEW ----- > PROGXX (becomes new PROGXX)
//* PROG3NEW ----- > PROG3 (replaces current member PROG3)
//* PROG4 ----- > PROG4 (replaces member PROG4)

IEHLIST


IEHLIST JCL REQUIREMENTS

//stepname  EXEC PGM=IEHLIST
//SYSIN      DD input IEHLIST control statement
//resource   DD disk volume containing the dataset
//SYSPRINT   DD message listing



IEHLIST JCL examples:

//CCPH00A JOB  1,'BIN 13 -- PETLICKI',MSGCLASS=X,MSGLEVEL=(1,1)
//STEP1     EXEC PGM=IEHLIST
//RESOURCE DD UNIT=SYSDA,VOL=SER=USER02,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSIN  DD *
   LISTPDS DSNAME=CCPH00.CSC.CNTL,VOL=SYSDA=USER02
//*  The listpds format is
//*   LISTPDS DSNAME=pdsname,VOL=device_name=volid
//**************************************************************************************************
//STEP2     EXEC PGM=IEHLIST
//RESOURCE DD UNIT=SYSDA,VOL=SER=USER02,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSIN  DD *
  LISTVTOC VOL=SYSDA=USER02
//*  The listvtoc format is
//*  LISTVTOC VOL=device_name=volid



EXERCISE (Value 35 points)

Create a multi-step JCL job that will create and delete datasets and copy members between datasets.

Correct assignments will only have return codes of 0000 and will have members A1,B1,C1,D1, GARBAGE and GRADES list as members of CCP#nn.CCP.PDS. Also be sure to avoid the NOT CATLG 2 problem


  a