JCL Session 3


IEBGENER - make 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
//******************************************************************
//* IEBGENER used with formatting directions
//*
//* GENERATE   MAXFLDS=Max_Nbr_of_FIELD_stmts,
//*            MAXLITS=Max_Nbr_of_literal_bytes
//*   RECORD   FIELD=(L,I,DC,O),
//*            FIELD=(Length,Input_start,Data_Conversion,Output_starts_at),
//*            FIELD=(Length,'literal',Data_Conversion,Output_start)
//*-+----1----+----2----+----3----+----4
//*
//******************************************************************
//STEPB EXEC PGM=IEBGENER
//SYSUT1 DD DSN=JPETLIC.CSC.CNTL(GRADES),DISP=SHR
//SYSUT2 DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
  GENERATE     MAXFLDS=99,MAXLITS=99
    RECORD       FIELD=(1,' ',,1),
               FIELD=(3,1,,2),
               FIELD=(3,' ',,5)
//*-+----1----+----2----+----3----+----4


JCL --- specifies the tasks and resources required for batch jobs.
JOB statement marks the beginning of a unit of work

//jobname JOB account_number,'label information',MSGCLASS=z,
//   MSGLEVEL=(x,y),CLASS=a,TIME=(m,s),
//   NOTIFY=userid


JOB Parameter Definitions -- Minimum parameters required at DePaul

//jobname JOB account_number,'label information',MSGCLASS=X,MSGLEVEL=(x,y)
  |       |   |               |                  |          |
  |       |   |               |                  |          MSGLEVEL
  |       |   |               |                  |          DePaul default = (2,1),
  |       |   |               |                  |          Recommend MSGLEVEL=(1,1)
  |       |   |               |                  |            x = print JCL options
  |       |   |               |                  |              0 - JOB stmt only
  |       |   |               |                  |              1 - ALL invoked
  |       |   |               |                  |              2 - JOB and JCL only
  |       |   |               |                  |            y = Sys print options
  |       |   |               |                  |              0 - only if job abends
  |       |   |               |                  |              1 - always
  |       |   |               |                  |
  |       |   |               |                  MSGCLASS
  |       |   |               |                  Always use X at DePaul
  |       |   |               |                         (X = Hold Output Queue)
  |       |   |               |                         (D = Print Output Queue)
  |       |   |               |
  |       |   |              'label information'
  |       |   |               optional info that usually prints on 1st cover sheet
  |       |   |
  |       |   account_number is optional and dependent on local standards -- who pays
  |       |
  |       JOB -- MANDATORY JCL statement when submitting a job to MVS
  |
  jobname -- mandatory, at DePaul it's your userid plus any arbitrary suffix character.


        Some Additional JOB Parameter Definitions


CLASS=a -- DePaul default = A, optional input that categorizes the job according to its special resource needs
 
TIME=(m,s) -- DePaul default = (30,0) determines how much CPU time to give the entire JOB
 
NOTIFY=userid --
 

EXEC statement names the program or procedure you want to run. //stepname EXEC PGM=x,TIME=(m,s),REGION=r,
// PARM='pgm_control',COND=(step,relational_operator,test_value)
 
SAMPLE EXEC STATEMENT: //STEPA EXEC PGM=IEBGENER
EXEC Parameter Definitions for starting  a program

//stepname EXEC PGM=x
  |        |    |
  |        |    PGM -- Name of an executable program
  |        |
  |        EXEC is a MANDATORY statement identifying program to run
  |
    stepname is MANDATORY. Up to 8 characters can be used


Some Additional EXEC Parameter Definitions for starting a program

TIME=(m,s)

        optional limit to the amount of CPU time allowed in a single step
 

PARM='pgm_control' -- depends on program requirements.

Can pass up to 100 characters of information
to program from JCL Program must be designed to
receive information from parameter statement.
COND=(step,relational_operator, test_value) Determines whether the step should be bypassed or executed based
on condition code from a previously executed program


EXEC Parameter Definitions for starting a Procedure


//stepname EXEC PROC=x
    |        |    |
    |        |    PROC -- Name of a procedure
    |        |
    |        EXEC is a MANDATORY statement identifying program to run
  |
    stepname is MANDATORY. Up to 8 characters can be used

SAMPLE EXEC STATEMENTS for procedures: //STEP123 EXEC PROC=MYPROC

//STEP123 EXEC COB2J,PDS='CCPX00.CSC.COBOL',MEMBER=PROG1



Batch program input can come from a

Batch program output can go to a

DD statements connect program references with external files. Any SELECT COBOL program file reference needs a corresponding ddname JCL statement.
In COBOL, ENVIRONMENT DIVISION, INPUT-OUTPUT SECTION,

SELECT clauses, such as: SELECT INTERNAL-PGM-NAME ASSIGN TO EXTNAME.
                                                                                                                    ¯
need JCL to point to a particular file for input / output                                 //EXTNAME DD etc

How do you know if a file is used for input or output?


SAMPLE DD REFERENCE: INSTREAM DATA (DATA INCLUDED WITH THE JCL) //SYSUT1 DD * input data follows immediately after this card
1234
5678
9938
/*             A /* can be used to indicate the end of instream data

DD PARAMETERS NEEDED FOR INPUT FROM CATALOGUED FILES What is a catalogue? What is a VTOC?

//ddname DD DSN=dataset_name,DISP=(x)
  |      |  |                |
  |      |  |                |
  |      |  |                DISP is required if a file is used,
  |      |  |                     NEW is default if DISP omitted
  |      |  |                     SHR (other jobs can read data with you)
  |      |  |                     OLD (your job has exclusive use)
  |      |  DSN = dataset/file name is required
    |      |
    |      DD is a MANDATORY statement when input or output is defined
    |
    ddname is required if dataset is used.  The ddname must match the external
         name used in program's SELECT -- ASSIGN clause

SAMPLE STATEMENTS FOR READING CATALOGUED FILES

Catalogued file                             //SYSUT1 DD DSN=JPETLIC.CSC.PRINTOUT,DISP=SHR

Member of catalogued PDS       //SYSUT1 DD DSN=JPETLIC.CSC.CNTL(GARBAGE),DISP=SHR



MORE ABOUT DISP= PROCESSING (Does the file exist / share or not / keep or not)

Format:    DISP=(start_status, normal_end, abend)
 
                            Start_status - specify whether exclusive or share
 

                            Normal_end DELETE - Erase catalogue entry and VTOC
PASS - Give location of dataset to next job steps
KEEP - Put entry in VTOC if one does not exist
UNCATLG - Erase from system catalogue
                Abend
  DELETE - Erase catalogue entry and VTOC
KEEP - Put entry in VTOC if one does not exist
UNCATLG - Erase from system catalogue


MORE SAMPLE DD INPUT STATEMENTS:


With either of the following, the data will be kept after it is read.

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

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



The following will delete the data after it is read.

//SYSUT1 DD DSN=CCPM44.SERIES,DISP=(OLD,DELETE)

What happens if the program abends?



The data will be deleted after it is read without a program abend.
If the program abends, the data will be kept.

//SYSUT1 DD DSN=CCPM44.SERIES,DISP=(OLD,DELETE,KEEP)


DD PARAMETERS NEEDED FOR INPUT FROM FILES THAT ARE NOT CATALOGUED



Two additional parameters for reading a file which is not catalogued

//ddname DD UNIT=unit,VOL=SER=volid

UNIT             - symbolic names         -- SYSDA || TAPE etc.
                                                                VIO - virtual disk - non permanent RAM
                         device type                --  Hardware type - 3330 || 3344 || 3390 || etc
                         hardware address     --  most restrictive - A58 || 00C etc

VOL=SER=     volume id of the unit. Could be 1 or more volumes, ie.
                         VOL=SER=xxxxxx or VOL=SER=(xxxxxx,yyyyyy,zzzzzz)
 


SAMPLE DD INPUT STATEMENT WHEN A FILE IS NOT CATALOGUED: //SYSUT1 DD DSN=CCPM44.SERIES,DISP=SHR,UNIT=SYSDA,VOL=SER=USER01

DD PARAMETERS NEEDED FOR OUTPUT TO A PRINT QUEUE

Parameters on DD if data is to be sent to the printer spool

//ddname DD SYSOUT=x,OUTLIM=amt,COPIES=n

SYSOUT         required (DePaul output classes are X = hold, D = print.)

OUTLIM         can range from 1 to 16777215 logical lines. If amt is reached during job
                         execution, the system abends with code 722

COPIES           can range from 1 to 255


SAMPLE OUTPUT STATEMENTS //SYSUT2 DD SYSOUT=X

//SYSPRINT DD SYSOUT=D,COPIES=2

//SYSUT2 DD SYSOUT=*



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)
 

DSN - Data set name

DISP - start_status - always exclusive use
            OLD - dataset already exists
            NEW - dataset does not exist
            MOD - dataset may or may not exist

- 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.
 

GRADES -- Sample of the input.


----+----1----+----2----+----3----+----4
LASPHI1212KANTER MELVIN       A A A
LASEDU1231TATUM ARTHUR        B B B B B
BUSACC1234WEDEMAN SALLY       A C D C C
BUSACC1584JONES SAM           B B D A
1112223333444444444444444444445566778899 (fields identified by numbers)




GRADES -- Sample of the output.


----+----1----+----2----+----3----+----4----+
LAS   PHI   1212   KANTER MELVIN          A 
LAS   EDU   1231   TATUM ARTHUR           B
BUS   ACC   1234   WEDEMAN SALLY          A 
BUS   ACC   1584   JONES SAM              B 
111   222   3333   44444444444444444444   55  (fields identified by numbers)


ASSIGNMENT(S):  Value  (25 points)

1. Copy IEBGENER procedure from the instructor account.

2. With one JOB statement, use two EXEC statements of IEBGENER.

3. In the first step, use IEBGENER to send a copy of your edited PRACTICE
    member to the SYSOUT=X hold queue.

4. In the second step, use program IEBGENER to send a reformatted copy of
    GRADES to the SYSOUT=X hold queue. Each of the first five fields (1-5)
    should print with three spaces between each field.

5. Check that condition code is 0000 and that you are printing your edited file.