SlideShare uma empresa Scribd logo
1 de 140
JOB CONTROL
 LANGUAGE
  Complete Overview
Session Objectives
 To understand the

    Job Control Language

        Introduction

        Overview

    JOB, EXEC and DD (Data Definition) Statements

        Syntax of the various statements

        Execution process




                                                     2
Sessions Outline
 Session 1 : Introduction to JCL

 Session 2 : JOB Statement

 Session 3 : EXEC Statement

 Session 4 : DD Statement

 Session 5 : Job Processing Overview

 Session 6 : Program Execution




                                        3
Introduction to JCL

     Session 1




                      4
Job Control Language (JCL)
 Describes to the
  operating system the
  work that has to be done
  and the resources
  required to do the work
                               MVS




                                       5
Need for JCL

                OS

Accounting Info    Resources
                    Program
  Region size
                  Job details
   Priority




          JCL




                                6
JCL Features
 Consists of a set of statements called as Job Control Statements

 Group of related JCL statements is known as Job

 JCL consists of one or more Jobs

 Job consists of Job steps to execute the instructions (tasks)




                                                                     7
Job Control Task

 Job Control Tasks,

     Entering Jobs

     Processing Jobs

     Requesting Resources

   are performed through,

     JCL Statements

     JES2 / JES3 Control Statements



                                           8
Job Entry Subsystem

 Receive jobs into the operating system and schedule them for processing

 Manages the output processing of the job (spooling)

 JES2 and JES3 are the two JES types provided by IBM

 JES2/JES3 subsystems are part of the OS that manages Batch jobs and

  Output




                                                                            9
Job Submission Process
            USER ACTIONS                                            SYSTEM ACTIONS




Determine       Create        Submit               JES interprets
   the           the           the                 JCL & Passes
   Job           JCL           Job                   it to MVS




                                        System                                 MVS does
                                       Messages                                the work




                                                     JES Collects
             User views &
                                                     the output &
             interprets the
                                                  information about
                 output
                                                        the job




                                                                                      10
JCL Statement Syntax

Identifier
  field

   //NAME      OPERATION    OPERAND     COMMENTS




      Name      Operation   Operand /     Comment
       field      field     Parameter       field
                               field



                                                    11
Identifier Field
 Identifier field indicates to the system that a statement is a JCL
   rather than data

 Code the Identifier field beginning in column 1

 Consists of

     Column 1 and 2 of all the JCL statements (//)

     Column 1 2 and 3 of a JCL statement ( //* for comment)

     Column 1 and 2 to mark end of data (/*)



                                                                       12
Name field
 Identifies a particular statement so that the other statements and
  the system can refer it

 Syntax

     name should start in column 3

     name is 1 through 8 alphanumeric

     name should be followed by a blank

     first character should be a alphabetic or national ( $, #, @)



                                                                       13
Operation Field
 Specifies the type of the statement

    Consists of characters in the syntax box for the statement

    Follows the name field

    Operation must be followed and preceded by at least one blank

    Must begin on or before column 16




                                                                  14
Parameter or Operand Field
 Also called as Operand field
 Must end before column 62
 Contains parameters separated by commas
    Positional and Keyword Parameters. An eg.
  //RT452216 JOB 45992,CLASS=A
    All positional parameters must precede all keyword parameters
    Subparameters may be coded under Parameters to add further
     meaning to the statement An eg.
  //RT452216 JOB (45992,100,40),COND=(9,LT)



                                                                  15
Comment Field
 Used to enter a comment in the output listing

 Used to document a job and its resource requirements

 Can be placed anywhere after the job statement

 Appears as //* in Column 1, 2 and 3

 Comment field can be coded till Column 80




                                                         16
JCL Statements - Basics
 Code the Operation, Operand and Comments fields in free form

  with at least one blank in-between

 Code the Name field immediately after the Identifier without any

  blank column

 All fields except for Operand must be separated by one blank

 Only Columns 1 to 71 are used for JCL Content

 Is case sensitive (Lower case not permitted)


                                                                     17
JCL Statements – Basics (Contd.)
 Statements can be continued in

  the next line with // in 1 & 2

  columns

 The continued line must start

  between columns 4 and 16

 Marking the end of the JCL is

  optional


                                         18
JCL Example




              19
JCL Statements - Essential
 Each Job is identified by a JOB statement that marks the beginning

  of a Job

    Every job has one and only one job statement

 Each Exec step is identified by an EXEC statement

    EXEC (Execute) Statements follow the JOB Statement and has

      the name of the Programs / PROC’s to execute




                                                                       20
JCL Statements – Essential (Contd.)
 Each Exec step may contain one or more control statements (DD
  statements) to describe resources required for the Job step

    DD Statements describe each data set & request the allocation
      of I/O devices

 Code the comment (//*) Statement to document the JCL

 Code the delimiter (/*) Statement for marking the end-of-data for
  in-stream data




                                                                      21
JCL Statements - Optional
 IF / THEN / ELSE / ENDIF Statement for selective execution of a Job

  Step

 SET Statement assigns symbolic parameter values

 INCLUDE Statement to copy JCL from a file into Job Stream

 PROC & PEND Statements mark the beginning and end of a

  Procedure (Cataloged / in-stream)

 JCLLIB Statement names the PROC & JCL Data set


                                                                        22
IF/THEN/ELSE/ENDIF

 Used to conditionally execute job step with job
 Examples:
  //NAME IF (RC GT 4) THEN

                                 To Test if RETURN-CODE > 4
   //NAME IF (STEP10.RC GT 4) THEN




                                         To Test if RETURN-CODE from the
                                         Job Step STEP10 > 4



                                                                           23
IF/THEN/ELSE/ENDIF : Example




                               24
SET Statement
 Assign initial values to symbolic parameters
 Change or Nullify the values of symbolic parameter
 Syntax:
   //[NAME] SET symbolic-parameter=values
 If there are more than one parameter, separate them by comma
 Example:
   //SP1 SET PARM1=OLD,PARM2=22201
 Parameter values containing special character enclosed by apostrophes
 Example:
   //SP3 SET PARM1=‘2004-10-13’



                                                                          25
INCLUDE Statement
 Identify the member of a partitioned dataset containing the JCL statement
 Syntax:
   //[NAME] INCLUDE MEMBER=name
 INCLUDE group cannot contain
     JOB Statement
     PROC and PEND statement
     JCLLIB statement
     JES2 and JES3 statement
     DD * and DD DATA statement




                                                                          26
NULL STATEMENT




Indicates End of Job


                          27
Summary
   What is JCL ?

   Purpose of JCL

   Structure of JCL - Examples

   Coding Basics of JCL Statements

   JCL Statements – Essential and Optional




                                              28
JOB Statement

   Session 2




                29
Session Coverage
   Purpose of JOB Statement

   Coding Syntax of JOB statements

   Positional and Keyword parameters in a Job Statement

   Examples




                                                           30
Purpose of JOB Statement
   Identifies a job to the OS using a job
    name

   Indicates which user is responsible
    for the job

   Tells the system how to process the
    job




                                             31
JOB Statement - Syntax
•
          Operation Field                   Comment Field


//Jobname JOB < parameters>..<comments>

    Name Field              Operand Field
    (Job Name)



                                                            32
JOB Statement - Name field


//TRGR02Y JOB .......

             Job name is TRGR02Y


              Job name is @TEST

//@TEST JOB .......


                                   33
JOB Statement - Operation field


//MYJOB JOB ...
                    JOB in Operation Field
                    specifies it as Job statement

//JOB1   JOB ...




                                                    34
Parameter Field
• //JOBNAME JOB <Parameters>

• The following list shows the parameters on Job statement
•  ACCT-PARAMETER
•  PROGRAMMER NAME
                                               Positional Parameters
•
• CLASS                    COND
•  PRTY                     NOTIFY
•  MSGCLASS                 RESTART
                                                          Keyword
•  MSGLEVEL               ADDRSPC
•  REGION                   TIME
                                                          Parameters
•



                                                                       35
Positional Parameters
   Job Statement can contain two positional parameters

   First parameter should contain Accounting Information and the second parameter

    should contain the Programmer’s name

   These two parameters are optional, but installation may define them as

    mandatory.




                                                                                 36
Positional Parameters - Accounting
                Information

 //JOB1 JOB (XYZ,TRG,3,DB2,123) ...........




                                               Accounting information
 //JOB2 JOB (XYZ,DHC,1,DTX99,TRGG01) ......




                                                                        37
Accounting Information in Real world
   Five Fields - all are mandatory

      Field1 - Group or Project

      Field2 - Sub-Group or module or Project

      Field3 - User-id

      Field4 - Location (here type D2 or D1)

      Field5 - Type of Job (Give DT99X)

   Example for Training:

    (TRG,TRG,TRGG01,D2,DT99X)




                                                 38
Positional Parameters - Programmer’s
                 Name
•
 //JOB1 JOB (XYZ,TRG,3,DB2,123),TRAINING.......


                                                        2nd positional parameter-
      Accounting parameter                              programmer's name
 //JOB2 JOB (XYZ,DH,1,DTX99,TRGR01),’XYZ TRG’.

 //JOB3 JOB ,’Shane o’’Hara’.....

                                                   Programmer's name
                                                   parameter in quotes


    No accounting                          Enclose programmer‘s name within
    parameter                              apostrophe if it contains special character




                                                                                         39
Key Word Parameters
The Job Statement (or Job Card) can contain the following Keyword
parameters

    CLASS                              PRTY
    TIME                               ADDRSPC
    REGION                             MSGCLASS
    MSGLEVEL                           NOTIFY
    COND                               RESTART
    TYPRUN




                                                                    40
Keyword Parameters - CLASS
 Syntax:
       CLASS=<job class>
 Examples:
 //JOB1 JOB ACCT1,CLASS=A..

 //JOB2 JOB ACCT1,CLASS=B....   JOB1 IS ASSIGNED TO CLASS A

 //JOB3 JOB ACCT1,CLASS=C....   JOB2 IS ASSIGNED TO CLASS B

 //JOB4 JOB ACCT1,CLASS=D....
                                 JOB3 IS ASSIGNED TO CLASS C


                                 JOB4 IS ASSIGNED TO CLASS D



                                                               41
Class Definitions in Real world
          Installation
   Class A -- 2 sec
   Class B -- 7 sec
   Class C -- 19 sec
   Class D -- 46 sec
   Class E -- 5 mins
   Class H -- Held Class
   Class T -- 5 mins (for tapes only)
   Class R -- 5 mins. (cartridges only)

 Time specified are CPU time




                                           42
Keyword Parameters - TIME
   Syntax:
                                               Allows this job to use 2 min
   TIME=([minutes][,seconds])                 30 sec of CPU time
   Examples:
   //JOB1 JOB ACCT1,CLASS=E,TIME=(2,30)....

                                                Allows this job to use
                                                30 sec of CPU time
 //JOB2 JOB ACCT1,CLASS=E,TIME=(,30)...

 //JOB3 JOB ACCT1,CLASS=E,TIME=2....          Allows this job to use
                                               2 mins of CPU time




                                                                              43
Keyword Parameters – TIME (Contd.)
   Syntax:
   TIME=([1440]| [NOLIMIT] | [MAXIMUM])
   Examples:
   //JOB4 JOB ACCT1,CLASS=E,TIME=1440....



 //JOB5 JOB ACCT1,CLASS=E,TIME=NOLIMIT....              These jobs can use the processor
                                                         for unlimited amount of time

 //JOB6 JOB ACCT1,CLASS=E,TIME=MAXIMUM....




                                              This job can run for maximum amount
                                              of time that is 357912 minutes.



                                                                                       44
Keyword Parameters - PRTY
   To assign the selection priority to the JOB

   Syntax:

 PRTY=(number)

   Examples:

 //JOB4 JOB ACCT1,CLASS=E,PRTY=12...




                                                  45
Keyword Parameters - REGION
 Syntax:
 REGION={valueK | valueM}

   Examples:
 //JOB1 JOB ACT1,CLASS=A,ADDRSPC=REAL,REGION=200K.



                                                   Specifies 200 kilo bytes of
 //JOB2 JOB ACT1,’TRG’,CLASS=A,REGION=20M.        central storage is required for
                                                   this job(JOB1)



                                       Specifies 20 mega bytes of
                                        virtual storage is required for
                                       this job(JOB2)



                                                                                     46
Keyword Parameters - ADDRSPC
 Syntax:
  ADDRSPC={REAL | VIRT}

 Examples:
  //JOB1 JOB ACT1,CLASS=A,ADDRSPC=REAL,REGION=20K
                Non pageable central storage of 20k
                is required for this job(JOB1)


 //JOB1 JOB ACT1,CLASS=A,ADDRSPC=VIRT,REGION=20K
                Pageable virtual storage of 20k
                is required for this job(JOB1)



                                                      47
Keyword Parameters - MSGCLASS
 Syntax:

  MSGCLASS=<class>

 Examples:

  //JOB1 JOB (XYZ,TRG,3,,123),’TRG GROUP’,

  //        CLASS=B,MSGCLASS=X...

  //JOB2 JOB (XYZ,TRG,3,,123),’TRG GROUP’,

  //        CLASS=B,MSGCLASS=A...




                                             48
Keyword Parameters - MSGLEVEL
 Details in the listing of Joblog can be controlled, using MSGLEVEL
   parameter
 Syntax:
   MSGLEVEL=([statements][,messages])
 Job log contains the following information :
     JCL Statements
     Procedure Statements for any procedure job step calls
     Messages about Job control statements, allocation of devices and
       volumes, execution and termination of job steps and disposition of
       datasets



                                                                            49
Keyword Parameters - MSGLEVEL
• Statements - Controls the listing of JCL statements in Job log
•   0 - The system prints the JOB statement, comments
•      and all statements up to the first EXEC
•      statement
•   1 – The system prints all the JCL statements, control
•      statements, Procedure statements and values
•      assigned to symbolic parameter’s
•   2 – The system prints all the JCL statements and control
    statements

                                                                   50
Keyword Parameters - MSGLEVEL
• Messages - To control the listing of JCL and JES

•             messages in Job log

•   0 – The system prints only the JCL messages

•   1 – The system prints, JCL, operator and SMS

•     messages




                                                     51
Statements sub-parameter -
               MSGLEVEL
 MSGLEVEL=([statements][,messages])
                                                 Only job statement
                                               is printed for job(job1)
 //JOB1 JOB AC1,MSGCLASS=X,MSGLEVEL=(0,1)..

                                                   NO parentheses ??
 //JOB2 JOB AC1,MSGCLASS=X,MSGLEVEL=2..

                                               Both Statements and
                                               Messages are printed
 //JOB3 JOB AC1,MSGCLASS=X,MSGLEVEL=(1,1)




                                                                   52
Messages sub-parameter - MSGLEVEL
 MSGLEVEL=([statements][,messages])            Only JCL messages are
                                                 printed for job(job1)

 //JOB1 JOB AC1,MSGCLASS=X,MSGLEVEL=(0,0)..

                                                No value for messages
                                                Sub-parameter. Takes
 //JOB2 JOB ACC1,MSGCLASS=X,MSGLEVEL=2..       default.



                                               All messages are printed
 //JOB3 JOB AC1,MSGCLASS=X,MSGLEVEL=(,1)




                                                                     53
Keyword Parameters - NOTIFY
 Syntax:
 NOTIFY=<user-id>     or
 NOTIFY=<nodeid.userid> or
 NOTIFY=<&SYSUID>                                 User-id TRGG01 is notified
 Examples:                                        after completion of this job

 //JOB1 JOB ACCT1,CLASS=A,NOTIFY=TRGG01..

 //JOB2 JOB ACCT1,NOTIFY=XYZMN03.TRGG02..

                                      User-id TRGG02 at XYZMN03 is
                                      Notified after completion of this job




                                                                        54
Keyword Parameters - TYPRUN
 Syntax:
 TYPRUN={HOLD|SCAN}
                                                Checks job’s JCL for syntax errors.
 Examples:                                     Job is not submitted for execution
  //JOB1 JOB ACCT1,MSGCLASS=X,TYPRUN=SCAN..



  //JOB2 JOB ACCT1,MSGCLASS=X,TYPRUN=HOLD..




                                              This job waits for execution until
                                              operator releases it for execution




                                                                              55
Keyword Parameter - RESTART
 Syntax:
 RESTART={* }       Restart job at first job step itself
           {stepname}
           {stepname.procstepname}
 Stepname:
      indicates the job step from which to restart the job
   Stepname.procstepname:
      stepname refers to the EXEC statement of the jobstep that calls the
       procedure.
      Procstepname refers to the EXEC statement of the procedure step.
      If the stepname refers to the EXEC statement in a procedure then
       procedure name is also specified.




                                                                             56
Keyword parameter - RESTART
 Example:
  //JOB1 JOB ACCT1,MSGCLASS=X,RESTART=COUNT..

                                           Restart from step
                                           COUNT



 //JOB1 JOB CCT1,MSGCLASS=X,RESTART=PROC1.COUNT..

                                                Restart from step
                                                COUNT in procedure
                                                step PROC1




                                                                     57
JOB Statement Examples
 Example 1 :
  //TRGG02X JOB (TRG,GEN,TRGG02,AA,DT99X),’TRG’,
  //   CLASS=B,MSGCLASS=X,NOTIFY=TRGG02

 Example 2 :
  //GEMT01XX JOB (GEM,CIC,GEMT01,D2,DT99X),
  //   ‘GEM-PROJ’,CLASS=C,MSGLEVEL=(1,1),
  //    MSGCLASS=X,NOTIFY=GEMT01




                                                   58
Summary
 The purpose of the JOB statement

 Coding Syntax of JOB statement

 Various options for the Positional and keyword parameters

 Examples of JOB statement




                                                              59
EXEC Statement

   Session 3




                 60
Session Coverage
 Purpose of Exec Statement

 Coding Syntax of Exec statements

 Positional and Keyword parameters in an Exec Statement

 Examples




                                                           61
Purpose of Exec Statement
 Used to specify which program or procedure an individual job step
  has to execute
 Tells system how to process the job step




                                                                      62
Exec Statement: Example

                                                              OS
                            Processing parameters

                      Beginning of step
                                             Parameters to program
        JCL                        Program or Proc name
//JOB1 JOB AC1,
// CLASS=A
//ST1 EXEC PGM=P1,
// PARM=‘04/11/01’.
// REGION=800K
// .....   DD ..
//



                                                                     63
EXEC Statement in JCL
•   //JOB1 JOB ....       •   Beginning of JOB
•   //ST1 EXEC PGM=P1     •   Beginning of step ST1
•   //INPUT DD .....      •   Statements that follow the Exec step ST1
•    .............        •
•    .............        •

•   //ST2 EXEC PGM=P2     •   Beginning of step ST2
•   //INPUT DD .....      •   Statements that follow the Exec step ST2
•          ..........     •
•   //                    •   End of Job




                                                                   64
EXEC STATEMENT - Syntax
•
          Operation Field                      Comment Field


//Stepname EXEC < parameters>.. <comments>


    Name Field              Parameters Field




                                                               65
Operation field


//MYSTEP EXEC ...
                       EXEC in Operation Field
                       specifies it as Exec statement
//STEP1    EXEC ...




                                                        66
Parameter Field
•   //STEPNAME EXEC <Parameters>

•   The following list shows the important parameters on Exec statement

•    PROGRAM NAME
•    (PGM= or PROC=)
                                                    Positional Parameter
•   ACCT                   PARM
•   ADDRSPC                REGION
•   TIME                   COND                                           Keyword
                                                                          Parameters




                                                                                  67
Positional Parameters
   Syntax:
       PGM=<program name> OR
       PROC=<procedure name> OR
       <procedure name>
   Examples:
    //STEP1 EXEC PGM=TEST
                                   STEP1 executes program TEST
    //STEP2 EXEC PROC=COMPILE

    //STEP3 EXEC COMPILE
                                  STEP2 & STEP3 invokes JCL
                                  procedure COMPILE




                                                                 68
Key Word Parameters
The EXEC statement can contain the following Keyword
parameters :

    ACCT             •
    PARM
    ADDRSPC
    REGION
    TIME
    COND




                                                       69
Key word Parameters
 ACCT – provides accounting information for the job step

 ADDRSPC – prevents the step from being paged

 REGION - specifies the region size to allocate to a job step

 TIME - imposes a CPU time limit on the job step




                                                                 70
Keyword Parameter - PARM
   Syntax:
    PARM=(<sub parameter,[sub parameter]>)
   Examples:                                   25/01/01 is enclosed in
                                                apostrophes because it contains
    //STEP1 EXEC PGM=P1,PARM=TRGXYZ             special characters ‘/’
    //STEP2 EXEC PGM=P2,PARM=(10,’25/01/01’)



    //STEP3 EXEC PGM=P3,PARM=‘25&&45’


                                               Passes string 25&45
                                               to program P3




                                                                        71
Program Execution using PARM
    JCL for executing program CP1         Cobol Program-CP1
•     //JOB1 JOB ACCT1,TRG-GRP,
•     // CLASS=B,NOTIFY=TRG???,     •   IDENTIFICATION DIVISION.
•     // MSGCLASS=X                 •   ENVIRONMENT DIVISION.
•     //*This is to demonstrate     •   DATA DIVISION.
      passing                       •   WORKING STORAGE SECTION.
•     //* parameters to program     •   LINKAGE SECTION.
      thru JCL
•     //STEP1 EXEC PGM=CP1,         •   01 WS-DATE
•     // PARM=‘31/03/01’            •    05 WS-CTRL-LEN PIC S9(4)
•     // ...... ......     .....        COMP SYNC.
•     //                            •        05 WS-CTRL-DATE X(8).
•     //*This JCL executes          •   PROCEDURE DIVISION USING
      program CP1                   •   WS-DATE.




                                                                 72
Keyword Parameter - COND
 Syntax:
 COND=(code,Operator[,step name]) [,EVEN | ONLY]
 Examples:
  //STP1 EXEC PGM=P1,COND=(0,NE)
                                                      If any preceding step
                                                      returns non zero return
                                                      code this step is bypassed
   //STP2 EXEC PGM=P2,COND=(4,LT,STP1)


                                                    If step STP1 returns a code less
                                                    than or equal to 4 then this step is
                                                    executed else bypassed.




                                                                                 73
Keyword Parameter- COND
   Examples:
    //STP1 EXEC PGM=P1,COND=EVEN

                                       STP1 is executed even if a
                                       preceding step abends
    //STP2 EXEC PGM=P3,COND=((4,LE,STP1),ONLY)



                                         STP2 is executed only if a preceding
                                         step abends and return code of STP1
                                         is less than 4




                                                                          74
Relational Operators for COND

              Rt r c d ( C f o jutc ml t dse
               eun o eR ) r m s o pee t p
c n pr mt r
 o d aa ee    c ni u j bi
               o tn e o f      t r i aej bi
                                em t o f
                                    n
C N =c d,G) R > c d
 O D( o e T C =o e             R <o e
                                Cc d
C N =c d,G) R >o e
 O D( o e E Cc d               R <c d
                                C=o e
C N =c d,E ) R ! c d
 O D( o e Q C =o e             R =o e
                                Cc d
C N =c d,L ) R < c d
 O D( o e T C=o e              R >o e
                                Cc d
C N =c d,L ) R <o e
 O D( o e E Cc d               R >c d
                                C=o e
C N =c d,N) R =o e
 O D( o e E Cc d               R! cd
                                C=o e

                                               75
COND Parameter with Return Codes
• Job requiring special
  Conditional execution
                                            •   ABOUT SELECT PROGRAM.
           STP1   If Step                   •   SELECT PROGRAM :
           SELECT ABENDS                    •   RETURNS - 0, IF AT LEAST ONE
                                                RECORD IS SELECTED FOR
                                                PROCESSING BY UPDATE
                              STP3              PROGRAM.
             RC               ABDMP   END
                                            •   RETURNS - 12, IF NO RECORDS
      12                                        ARE SELECTED FOR
                0                               PROCESSING BY UPDATE
           If Records Exist
                                                PROGRAM.
           to Process

           STP2   If Step
END
           UPDATE ABENDS


                                                                           76
COND Parameter with Return Codes
             (Contd.)
 JCL for executing JOB described in the previous slide
  //JOB1 JOB ACT1,TRG,CLASS=B,NOTIFY=TRGXXX
  //STP1 EXEC PGM=SELECT
 ..... ...... DD STATEMENTS......
  //STP2 EXEC PGM=UPDATE,COND=(12,LE,STP1)
  ..... ...... DD STATEMENTS......
  //STP3 EXEC PGM=ABDMP,COND=ONLY
  ..... ...... DD STATEMENTS......
  //

                                                          77
EXEC Statement Examples
•   //TRGR02XX JOB (TRG,GEN,TRGR02,AA,DT99X),
•   // ‘TRG’,CLASS=B,NOTIFY=TRGR02,MSGCLASS=X


•   //ALLOC EXEC PGM=IEFBR14                    This step allocates data sets
•   .... ........ .......... .......... ....
•   //COB EXEC PGM=IGYCRCTL,COND=(4,LT),  This step compiles a program
•   //      PARM=‘NUM,SOURCE,LIB,RES’,
•   //      REGION=2048K
•   .... ........ .......... .......... ....
•   //STPZ EXEC PGM=IEWL,PARM=‘REUS,LET’,  This step does link editing
•   // COND=((4,LT,COB),(4,LT,ALLOC))
•   .... ........ .......... .......... ....
•   //

                                                                                 78
DD statement in EXEC cont....

•              DD statement in EXEC statement is optional. DD statement is used
for specifying any input to the program or to specify where the output is to be
printed. If there is no input file and if there is no need of output, then we can
ignore the DD statement in EXEC part.
•              System generation programs and the programs that are in system
library syslib and proclib can be executed by using EXEC statement without a
DD statement.

•Eg: //TRGRXX JOB 'MVS-MVS-U237011-Z9-DT08X',REGION=2096K
•    //IKJACCNT EXEC IKJACCNT
•            Once you login the mainframes region, the above job will start
executing automatically, this needs no DD statement.


                                                                                    79
Summary
 The purpose of the Exec statement

 Coding Syntax of Exec statement

 Various options for the Positional and keyword parameters

 Examples of Exec statement




                                                              80
DD Statement

 Session 4




               81
Session Coverage
 Purpose of DD Statement

 Coding Syntax of DD statements

    Temporary data sets

    DASD data sets

    Instream and SYSOUT data sets

 Examples




                                     82
Purpose of DD Statement
•
                                             OS
                  I/P & O/P data sets
                                           Program location

    Data set integrity Constraints
                                     Input data

                             Resources required by job & processing program


             DD Statements




                                                                              83
DD Statement in JCL

•   //JOB1 JOB ACT1,NOTIFY=TRGXXX
•   //STEP1 EXEC PGM=P1
•   //DD1 DD ...
•   //DD2 DD ...                  DD statements for step STEP1
•   ....
•   //STEP2 EXEC PGM=P2
•   //INDD DD ...
                                  DD statements for step STEP2
•   //DD2 DD ...
•   ....
•   //



                                                                 84
DD Statement - Syntax
•
       Operation Field                       Comment Field


//ddname DD              < parameters>.. <comments>


    Name Field             Key word Parameters Field
    (DD Name)



                                                             85
Keyword Parameters for DASD
               datasets
• //ddname DD DSNAME=dataset name
•         ,DISP=file’s status
•     [   ,UNIT=device where the file exists ]
•     [   ,VOL=SER=serial number of the volume ]
•     [   ,SPACE=DASD space to be allocated ]
•     [   ,DCB=Options for file’s data control block ]




                                                         86
DSNAME Parameter

 DSN Parameter specifies the Physical file name to be associated
  with the DD Name referred by processing program or system.

       DD Name                         Data set name in DSN


LOGICAL FILES NAME or                   PHYSICAL DATA SET
DD NAME - Referred by                   For the DD name referred
processing program or system            by program or system




                                                                    87
DSNAME Parameter
 Syntax:
  DSN=<data set name> | <DSNAME(member)>| NULLFILE

 Dataset name can be :
    Qualified data set name
    Unqualified data set name
    NULLFILE
    PDS member name
    Temporary data set name




                                                     88
DSNAME Parameter : Examples
 Qualified data set name
  //INFILE DD DSN=TRGXX.SRC.COBOL, .....
 Unqualified name as data set name
  //DD1 DD DSNAME=TRGXX, ......
 Data set name for a Dummy Data set
  //OUTFILE DD DSN=NULLFILE
 Member of a PDS as data set name(qualified data set name)
  //INFILE DD DSN=TRGXX.SRC(MEM1) .....


                                                              89
Temporary Dataset

 Syntax:

  DSN=&&<data set name>

 Dataset exists only during the execution of job. Usually called as Work files.

 Always deleted at the end of job

 Resides in Virtual Storage

 Compound DSN, joined by period not allowed in temporary dataset




                                                                                   90
Temporary Dataset : Example




                              91
DD Statements in relation with
                 programs
Cobol Program-CP1                   JCL for executing program CP1
•   IDENTIFICATION DIVISION.    •     //JOB1 JOB ACCT1,TRG-GRP,
•   ENVIRONMENT DIVISION.       •     // CLASS=B,NOTIFY=TRG???,
•   SELECT INPUT ASSIGN TO      •     //STEP1 EXEC PGM=CP1
•    INDD.                      •     //INDD DD ......
•   SELECT OUTPUT ASSIGN TO     •     //OUTDD   DD .......
•    OUTDD.                     •     //
•   DATA DIVISION.              •     //*This is to demonstrate
•   WORKING STORAGESECTION.           relation between program
                                      ddnames names to ddnames in
•   PROCEDURE DIVISION.......
                                      JCL.
    ......   .......
                                •     //*This Run JCL for program
                                      CP1




                                                                    92
DISPOSITION Parameter - DISP
 Syntax:
  DISP=<([current status][,normal termination DISP]
          [,abnormal termination DISP])>

     CURRENT         NORMAL                ABNORMAL
      STATUS       TERMINATION           TERMINATION
       NEW            DELETE          DELETE
       OLD         KEEP               KEEP
       SHR            PASS               CATLG
       MOD         CATLG              UNCATLG
                   UNCATLG


                                                       93
DISP-Current Status : Examples
 Sharing the already existing data set.
  //INFILE DD DSN=TRGXX.SRC(MEM1),DISP=SHR
 Exclusive control over already existing data set or writing to existing
  data set. Existing records will be deleted.
  //OUTFILE DD DSN=TRGXX.OUT,DISP=OLD
 Creating new data set.
  //NEWDD DD DSN=TRGXX.NEW,DISP=NEW........
 For updating the existing data set in exclusive access mode and is
  positioned at the end of the data, so the records may be added to
  the end.
  //DD1 DD DSN=TRGXX.TRN,DISP=MOD .....

                                                                        94
DISP-Normal Termination : Examples
 Request to keep the data set on normal completion of step.
  //INFILE DD DSN=TRGXX.SRC,DISP=(SHR.KEEP)
 To delete the data set on normal completion of step.
  //OUTFILE DD DSN=TRGX.OUT,DISP=(OLD,DELETE)
 To catalog the data set on normal termination of step.
  //NEWDD DD DSN=TRGX.NEW,DISP=(NEW,CATLG)
 To pass data set for use by subsequent step on normal termination
  of step.
  //DD1 DD DSN=TRGXX.TRN,DISP=(MOD,PASS)

                                                                  95
DISP-Abnormal Termination : Examples
 To Keep the data set on abnormal completion of step.

  //FILE1 DD DSN=TRGX.SRC,DISP=(SHR,PASS,KEEP)

 To Uncatalog the data set on abnormal completion of step.

  //OUT1 DD DSN=TRGX.OUT,DISP=(OLD,,UNCATLG)

 To Catalog the data set on abnormal termination of step.

  //NEWDD DD DSN=TRGX.NEW,DISP=(NEW,,CATLG)

 To Delete data set on abnormal termination of step.

  //DD1 DD DSN=TRGXX.TRN,DISP=(,PASS,DELETE)


                                                              96
DISP Parameter - Defaults
• DISP coded on DD statement                System Interpretation
•                                           by default

•   NO DISP PARAMETER                 DISP=(NEW,DELETE,DELETE)
•   DISP=SHR                          DISP=(SHR,KEEP,KEEP)
•   DISP=OLD                          DISP=(OLD,KEEP,KEEP)
•   DISP=(,CATLG)                     DISP=(NEW,CATLG,CATLG)
•   DISP=(OLD,,DELETE)         DISP=(OLD,KEEP,DELETE)
•   DISP=MOD (Treated as new) DISP=(MOD,DELETE,DELETE)
•   DISP=MOD (Treated as old )        DISP=(MOD,KEEP,KEEP)




                                                                 97
Parameters to Define Location of
                 Datasets
 UNIT
     Specifies the physical device where an existing dataset can be found or
      where a new one can be found
     Specify only installation defined group of devices
 VOLUME
     Specifies the volume serial number of the particular tape or disk
      involved
     Volume parameter is optional for new datasets
 For Cataloged datasets, Unit and Volume details need not be specified




                                                                           98
UNIT Parameter
 Syntax:
  UNIT=({[device-number][device-type] [group-name]}
            {[,unit-count] [,P]} [,DEFER] )
  or UNIT=AFF=ddname
 Examples:
  //DD1 DD DSN=TRG1.U1,DISP=(NEW,KEEP),
  // UNIT=3380                     device-type


  //DD2 DD DSN=TRG1.U,UNIT=SYSDA                 group name



                                                              99
UNIT Parameter
• //DD1 DD DSN=TRG1.U1,DISP=MOD,
• // UNIT=(3390,2)     2 devices are requested

• //DD2 DD DSN=TRG1.U,DISP=SHR,
• // UNIT=(,,DEFER)    request to defer mounting

• //DD3 DD DSN=TRG1.AFF,DISP=OLD,
• // UNIT=AFF=DD1      requests same two devices as
•               Step DD1




                                                      100
VOLUME Parameter
 Syntax:
  VOLUME= ([PRIVATE] [,RETAIN]
  [,vol-seq-number] [,vol-count]
  [,{SER=(ser-no[,ser-o]..)} {REF=dsname}{REF=*.ddname}] )




                                                             101
VOLUME Parameter : Examples
• //IN DD DSN=TRG.V1,DISP=(,KEEP),SPACE=(TRK,10).
• // VOLUME=(PRIVATE,SER=WORK01)

• //OUT1 DD DSN=TRG.V2,DISP=SHR,
• // VOLUME=(,RETAIN,2)

• //OUT2 DD DSN=TRG.V3,DISP=NEW,SPACE=(1024,10),
• // VOLUME=(,RETAIN,,2,SER=(DEV01,DEV02))




                                                    102
VOLUME Parameter : Examples
• //IN DD DSN=TRG.V1,DISP=(,KEEP),SPACE=(TRK,10),
• // VOLUME=(,RETAIN,REF=TRG.V1)

• //OUT1 DD DSN=TRG.V2,DISP=SHR,
• // VOLUME=SER=DEV01

• //OUT2 DD DSN=TRG.V3,DISP=NEW,SPACE=(1024,10),
• // VOLUME=REF=*.OUT1




                                                    103
SPACE Parameter
 Syntax:
  SPACE=
  ({TRK,}(prqty[,secqty][,dir])[,RLSE][,CONTIG][,ROUND])
  {CYL,}
  {blklen,}


           Number of Units       Special Processing Requests


Measurement
Unit



                                                               104
DCB Parameter
 DCB to define the Characteristics of individual data sets.
 Syntax:
   DCB=(LRECL=nn[,BLKSIZE=yy][,RECFM=zz]
    [,DSORG=mm])
   nn - Logical Record Length
   yy   - Block size
   zz   - Record Format (F,FB,V,VB or U)
   mm - Data Set Organization (PS or PO)



                                                               107
DCB Parameter : Examples
 DCB for new PS data set with fixed record length of 80 with
  blocking(block contains 10 records)
 //DD1 DD DSN=TRG.DCB,DISP=(NEW,CATLG),
 // DCB=(LRECL=80,RECFM=FB,BLKSIZE=800),
 // SPACE=(TRK,(5,5))
 DCB for new PDS data set with variable record length of 80 and no
  blocking..
 //DD1 DD DSN=TRG.DCB,DISP=(NEW,CATLG),
 // DCB=(LRECL=80,RECFM=V,DSORG=PO),
 // SPACE=(TRK,(5,5,2))

                                                                      108
DD Statement for Instream data sets
 Syntax:
  //ddname DD (*)       [ ,DLM=xx ]
        (DATA)


 Programs will treat the instream data as if it comes from a
  sequential file of 80-Character records
 JES will copy the instream data to a spool volume
 Processing program can retrieve data from spool volume as it
  executes



                                                                 109
Instream data sets : Examples
 Example 1:
  //INDATA DD *
  Bh009189lk56
  Akp0789mjirm
  /*
 Example 2:
  //INDATA DD DATA,DLM=@@
  //STEP1 EXEC PGM=INPROG
  //INPFIL DD SYSOUT=A
  /*



                                      110
DD Statement for SYSOUT data sets
 Syntax:
  //ddname DD SYSOUT=x

 Example:
  //SYSPRINT DD SYSOUT=A

 The SYSOUT parameter
    indicates that the data set should be processed by JES2/JES3
    Specifies the output class associated with the data set




                                                                    111
DD Statements for Execution related
              Data sets
 Specifying private program library

    JOBLIB

    STEPLIB

 Specifying dump data set




                                        112
Specifying Private Program libraries
 Private libraries are specified to execute programs that do not
   reside in the system libraries

 Job library applies to entire job

 Step libraries applies to only one step in a job

 If both JOBLIB and STEPLIB DD statements are coded, step library is
   searched first

(Job library ignored for that job step)




                                                                    113
JOBLIB : Example

•   //MM01E JOB (36512),'LE MENENDEZ',NOTIFY=MM01
•   //JOBLIB DD DSNAME=MMA.TEST.LOADLIB,DISP=SHR
•   //STEP1 EXEC PGM=IEBGENER
•   .
•   .
•   //STEP2 EXEC PGM=ORD2200A
•   .
•   .




                                                    114
STEPLIB : Example
•   //MM01F JOB (36512),'LE MENENDEZ',NOTIFY=MM01
•   //STEP1 EXEC PGM=IEBGENER
•   .
•   .
•   //STEP2 EXEC PGM=ORD2200A
•   //STEPLIB DD DSNAME=MM01.TEST.LOADLIB,DISP=SHR .
•   .
•   .




                                                       115
Specifying Dump data set
 Storage dump is the content of the virtual storage used by the
  program before the job terminates with error

 To obtain storage dump, code DD statement named
  SYSUDUMP, SYSABEND, or SYSMDUMP

 Syntax:

  //SYSDUMP DD SYSOUT=*

 If a job step ends normally, the dump DD statement is ignored




                                                                   116
Summary
 The purpose of the DD statement
 Coding Syntax of DD statements for
    Temporary data sets
    DASD data sets
    Instream data sets
    SYSOUT data sets
 Dataset Attributes
 DD Statements to specify private library data sets and dump data
  sets

                                                                     117
In-Stream and Cataloged Procedures
•
•             As you gain more experience in submitting jobs, you will
    find that you often use the same set of job control statements
    repeatedly with little or no change.
•
•             To save time and prevent errors, you can prepare sets of
    job control statements that you can execute again and again. You
    can do this through the use of two types of procedures: in-stream
    procedures and cataloged procedures.




                                                                         118
In-Stream procedure
•                  An in-stream procedure is a named set of job control
    statements in a job that can be re-executed within that job, simply
    by invoking the name of the procedure.

•                This enables you to execute the set of control
    statements more than one time in the same job without having to
    repeat the statements.

• The maximum number of in-stream procedures you can code in any
  job is 15.




                                                                      119
Example     ..
•   Job Control Statement                         Explanation
•    //JOB1 JOB CT1492,'JIM MOSER'                  Starts job
•   //PTEST PROC                            Starts in-stream procedure
•    //PSTA EXEC PGM=CALC                   Identifies first step in procedure
•   //DDA DD DSNAME=D.E.F,DISP=OLD          Request 3 data sets for first procedure step
•   //DDB DD DSNAME=DATA1,DISP=(MOD,PASS)
•   //DDOUT DD SYSOUT=*

•    //PSTB EXEC PGM=PRNT                    Identifies second step in procedure
•   //DDC DD DSNAME=*.PSTA.DDB,DISP=OLD           Request 2 data sets for second procedure step
•   //DDREP DD SYSOUT=A
•   // PEND                                        Ends in-stream procedure

•   //STEP1 EXEC PROC=PTEST                        First step in JOB1, executes procedure
•   //PSTA.IN DD *                                 Adds in-stream data to procedure step
•       .                                          PSTA
•       (data)
•       .
•   /*

•


                                                                                             120
Cataloged Procedure
•              A cataloged procedure, like an in-stream procedure, is a
    named set of job control statements. However, these control
    statements are placed, or cataloged, in a partitioned data set (PDS)
    known as a procedure library. This enables a cataloged procedure
    to be invoked by any job.

•              Cataloged procedures can be placed in the system
    procedure library SYS1.PROCLIB or in any user-specified procedure
    library (for example JCLLIB).




                                                                      121
Example...
•   Job Control Statement                                Explanation
•   //MYPROC PROC                                       Starts cataloged procedure
•   //MY1 EXEC PGM=WORK1                                 Identifies first step in procedure
•   //MYDDA DD SYSOUT=A                Request 2 data sets for first procedure step
    //MYDDB DD SYSOUT=*
    //MY2 EXEC PGM=TEXT5                                 Identifies second step in procedure
•   //MYDDC DD DSNAME=F.G.H,DISP=OLD                      Request 2 data sets for second procedure
    step
    //MYDDE DD SYSOUT=*
     // PEND                                             Indicate end of procedure



•   Job Control Statement                               Explanation
•    //JOB2 JOB ,'JACKIE DIGIAN'                        Starts job
•   //STEPA EXEC PROC=MYPROC                          First step in JOB2, executes procedure
•   //MY2.MYDDC DD DISP=(OLD,DELETE)                    Modifies DD statement MYDDC in procedure
    step MY2




                                                                                                 122
Job Processing Overview

       Session 5




                          123
Job Processing
•
    Input               Conversion
                                              Errors
    Phase                 Phase

                                             No        Yes

     Output             Execution
     Phase               Phase

                             Error Details
                             Phase
     Purge        End
     Phase        Job

                                                       124
JES (Job Entry Subsystem)

 Internal Readers JES2/JES3
   handles the Input Processing
 JES will select from the
   initiator, the highest priority
   job classes to run
 Initiator allocates the
   resources required for the
   job



                                       125
Conversion Processing
 Conversion processing
    assigns a job number to the job
    analyzes the JCL statements
    merges in any cataloged procedures which they reference
    converts the JCL into "internal text", which is meaningful to JES
     and the MVS job scheduler
    checks for syntax errors
    invokes various user exits
    if no errors are found, the converter stores the internal text on
     the "spool" dataset and adds the job to the input queue

                                                                         126
Execution Processing
 JES2 keeps track of each job by
  building a Job Queue Element
 On the Queue, job is selected by
    Is initiator available for this
      job class
    If more than 1 class for the
      initiator, then select in order
      of class
    Is the priority of the job
      highest in the queue for this
      job class
 At the completion of the job, JES
  places the job in output queue
                                        127
Spooling
         Simultaneous Peripheral Operations On Line

 Spool is a buffer that holds
  O/P for printers and process
  instructions as devices
  become available
 As one task is waiting for
  resource, the next one is
  taken for execution
 All output to spooled devices
  is first written to disk
 Spooled O/P is then stored
  and scheduled until the
  printer is available

                                                      128
Output/Print/Purge Processing
 JES2 processes SYSOUT data sets either when job ends or data set is

   closed

 O/P datasets are written to Print files in JES2 SPOOL

 The Print Processors selects the job by priority within class and

   print output

 Once job processing is completed, the access space released and

   job number becomes available for a new job


                                                                      129
Input-Conversion-Execution : Summary
•
                       Spool

JCL         Input
            Phase      Input
                       Queue


          Conversion    Job
Proclib     Phase      Queue


          Execution    Output
                       Queue
           Phase



                                  130
Program Execution

    Session 6




                    131
Fundamentals
 Modular programming:
    Aims to split a problem into small, manageable units of work
     (modules).
 Source module:
    Program written in a symbolic language.
    Forms the input to a language translator.
 Object module:
    The output from a language translator.
    Forms the input to the linkage editor.
    An object module may, however, be directly executed via the Loader.
 Load module:
    The output from the linkage editor; it is in a readily executable
     format.
                                                                         132
Job Execution




                133
Compile-Link-Edit




                    134
DD Names for compile-link-go
•
                        procedures
    COBOL Compile Step DD names
•   SYSIN -       Source program input for the COBOL compiler.
•   SYSLIB - The copy library or libraries.
•   SYSLIN - Object module output.
•   SYSPRINT- Print Data set
•   Link-edit Step DD names
•   SYSLIB - The subprogram library or libraries.
•   SYSLIN - Object module input.
•   SYSIN -       Additional object module input.
•   SYSLMOD - Load module output.
•   Execute (run) step DD names
•   SYSOUT -              Output from DISPLAY statements.
•   SYSDBOUT -            Symbolic debugging output.
•   SYSABEND/SYSUDUMP- Abnormal termination (or storage dump)
    output.

                                                             135
Linkage-editor Parm Options
 LIST - lists the linkage-editor control statements
 MAP - produces a storage map showing the length and relative
   locations of all control sections.
 XREF - includes MAP plus a cross-reference table of the load
   module.
 AMODE - value specifies whether the program uses 24- or 31- or
   64- bit addressing
 RMODE - value indicates where in Virtual Storage, the program
   must be loaded (24 or ANY)


                                                                   136
Sample Compilation Job steps
• //COMP EXEC PGM=IGYCRCTL,
• //
  PARM='SOURCE,APOST,MAP,LIST,LIB,NOCMPR2,XREF,FDUMP'
• //*
• //STEPLIB DD DSNAME=IGY.V2R1M0.SIGYCOMP,DISP=SHR
• //SYSIN DD DSN=&SRCE(&MEMBER),DISP=SHR
• //*SYSLIB DD DSN=copy-book-dataset-name,DISP=SHR
• //SYSPRINT DD SYSOUT=*
• //SYSLIN DD DSN=&&LOADSET,DISP=(NEW,PASS),
• // SPACE=(10,(25,5),,,ROUND),UNIT=3390
• //SYSUT1 DD UNIT=VIO,SPACE=(CYL,(1,1))
• //*

                                                        137
Sample Link Edit Job steps
   Example on multiple load module processing

//LKED EXEC PGM=IEWL,
// PARM='AMODE=31,RMODE=ANY,TEST,LIST,
// XREF,LET,MAP',REGION=512K
//SYSLIB DD DSNAME=CEE.SCEELKED,DISP=SHR
//     DD DSNAME=CEE.SCEERUN,DISP=SHR
//LIB1 DD DSN=TRG1T.TEST.DSN1,DISP=SHR
//LIB2 DD DSN=TRG1T.TEST.DSN2,DISP=SHR
//SYSLMOD DD DSN=TRG1T.TEST.LOAD,DISP=SHR
//SYSUT1 DD SPACE=(1024,(50,50)),UNIT=VIO
//SYSPRINT DD SYSOUT=*
//SYSLIN DD DSN=&&LOADSET,DISP=(OLD,DELETE)
//     DD DDNAME=SYSIN
//SYSIN DD *
   NAME LOAD1(R)
   INCLUDE LIB1(MEM1,MEM2,MEM3)
   NAME LOAD2
/*

                                                 138
Sample Run Job
•   //STEP1 EXEC PGM=TEST
•
•   //STEPLIB DD DSN=TRG1T.COBOL.LOAD,DISP=SHR
•   //DTXN DD DSN=TRG1T.COBOL.PGM,DISP=(SHR,KEEP)
•   //SYSOUT DD SYSOUT=*
•   //SYSDBOUT DD SYSOUT=*
•   //SYSABOUT DD SYSOUT=*
•   //SYSIN DD DUMMY




                                                    139
Summary
 The Compilation-Linkedit and execution procedure

 DD Statements involved in Compile-Linkedit-Run steps

 Sample Compilation and Linkedit jobs

 Sample Run JCL




                                                         140
References

 z/OS V1R3.0 MVS JCL Reference - Redbook

 z/OS V1R2.0 MVS JCL User's Guide – Redbook

 Murach’s Os/390 and z/OS JCL by Raul Menendez and Doug Lowe




                                                                141
THANK YOU




            142

Mais conteúdo relacionado

Mais procurados

JCL FOR FRESHERS
JCL FOR FRESHERSJCL FOR FRESHERS
JCL FOR FRESHERSNirmal Pati
 
Z OS IBM Utilities
Z OS IBM UtilitiesZ OS IBM Utilities
Z OS IBM Utilitieskapa rohit
 
Xdc command-to-print-job-output-and-syslog-from-sdsf
Xdc command-to-print-job-output-and-syslog-from-sdsfXdc command-to-print-job-output-and-syslog-from-sdsf
Xdc command-to-print-job-output-and-syslog-from-sdsfMaintec Technologies Inc.
 
Mainframe refresher-part-1
Mainframe refresher-part-1Mainframe refresher-part-1
Mainframe refresher-part-1vishwas17
 
ALL ABOUT DB2 DSNZPARM
ALL ABOUT DB2 DSNZPARMALL ABOUT DB2 DSNZPARM
ALL ABOUT DB2 DSNZPARMIBM
 
Introduction of ISPF
Introduction of ISPFIntroduction of ISPF
Introduction of ISPFAnil Bharti
 
Assembler Language Tutorial for Mainframe Programmers
Assembler Language Tutorial for Mainframe ProgrammersAssembler Language Tutorial for Mainframe Programmers
Assembler Language Tutorial for Mainframe ProgrammersSrinimf-Slides
 
Basic concept of jcl
Basic concept of jclBasic concept of jcl
Basic concept of jclAnil Bharti
 
Jcl interview questions
Jcl interview questionsJcl interview questions
Jcl interview questionsganjigirish
 
DB2 Interview Questions - Part 1
DB2 Interview Questions - Part 1DB2 Interview Questions - Part 1
DB2 Interview Questions - Part 1ReKruiTIn.com
 
JCL UTILITIES IEBCOPY
JCL UTILITIES IEBCOPYJCL UTILITIES IEBCOPY
JCL UTILITIES IEBCOPYjanaki ram
 
DB2 for z/OS and DASD-based Disaster Recovery - Blowing away the myths
DB2 for z/OS and DASD-based Disaster Recovery - Blowing away the mythsDB2 for z/OS and DASD-based Disaster Recovery - Blowing away the myths
DB2 for z/OS and DASD-based Disaster Recovery - Blowing away the mythsFlorence Dubois
 
Vsam interview questions and answers.
Vsam interview questions and answers.Vsam interview questions and answers.
Vsam interview questions and answers.Sweta Singh
 
Advanced REXX Programming Techniques
Advanced REXX Programming TechniquesAdvanced REXX Programming Techniques
Advanced REXX Programming TechniquesDan O'Dea
 
IBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration BasicsIBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration BasicsIBM
 

Mais procurados (20)

JCL FOR FRESHERS
JCL FOR FRESHERSJCL FOR FRESHERS
JCL FOR FRESHERS
 
Z OS IBM Utilities
Z OS IBM UtilitiesZ OS IBM Utilities
Z OS IBM Utilities
 
Xdc command-to-print-job-output-and-syslog-from-sdsf
Xdc command-to-print-job-output-and-syslog-from-sdsfXdc command-to-print-job-output-and-syslog-from-sdsf
Xdc command-to-print-job-output-and-syslog-from-sdsf
 
MVS ABEND CODES
MVS ABEND CODESMVS ABEND CODES
MVS ABEND CODES
 
Mainframe refresher-part-1
Mainframe refresher-part-1Mainframe refresher-part-1
Mainframe refresher-part-1
 
ALL ABOUT DB2 DSNZPARM
ALL ABOUT DB2 DSNZPARMALL ABOUT DB2 DSNZPARM
ALL ABOUT DB2 DSNZPARM
 
Mainframe interview
Mainframe interviewMainframe interview
Mainframe interview
 
Tso and ispf
Tso and ispfTso and ispf
Tso and ispf
 
DB2 utilities
DB2 utilitiesDB2 utilities
DB2 utilities
 
Introduction of ISPF
Introduction of ISPFIntroduction of ISPF
Introduction of ISPF
 
Assembler Language Tutorial for Mainframe Programmers
Assembler Language Tutorial for Mainframe ProgrammersAssembler Language Tutorial for Mainframe Programmers
Assembler Language Tutorial for Mainframe Programmers
 
Basic concept of jcl
Basic concept of jclBasic concept of jcl
Basic concept of jcl
 
Jcl interview questions
Jcl interview questionsJcl interview questions
Jcl interview questions
 
DB2 Interview Questions - Part 1
DB2 Interview Questions - Part 1DB2 Interview Questions - Part 1
DB2 Interview Questions - Part 1
 
JCL UTILITIES IEBCOPY
JCL UTILITIES IEBCOPYJCL UTILITIES IEBCOPY
JCL UTILITIES IEBCOPY
 
DB2 for z/OS and DASD-based Disaster Recovery - Blowing away the myths
DB2 for z/OS and DASD-based Disaster Recovery - Blowing away the mythsDB2 for z/OS and DASD-based Disaster Recovery - Blowing away the myths
DB2 for z/OS and DASD-based Disaster Recovery - Blowing away the myths
 
Vsam interview questions and answers.
Vsam interview questions and answers.Vsam interview questions and answers.
Vsam interview questions and answers.
 
Advanced REXX Programming Techniques
Advanced REXX Programming TechniquesAdvanced REXX Programming Techniques
Advanced REXX Programming Techniques
 
IBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration BasicsIBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration Basics
 
Sort presentation
Sort presentationSort presentation
Sort presentation
 

Destaque

online training for IBM DB2 LUW UDB DBA
online training for IBM DB2 LUW UDB DBAonline training for IBM DB2 LUW UDB DBA
online training for IBM DB2 LUW UDB DBARavikumar Nandigam
 
The best Teradata RDBMS introduction a quick refresher
The best Teradata RDBMS introduction a quick refresherThe best Teradata RDBMS introduction a quick refresher
The best Teradata RDBMS introduction a quick refresherSrinimf-Slides
 
My cool new Slideshow!
My cool new Slideshow!My cool new Slideshow!
My cool new Slideshow!Anas Mohammed
 
DB2 V8 - For Developers Only
DB2 V8 -  For Developers OnlyDB2 V8 -  For Developers Only
DB2 V8 - For Developers OnlyCraig Mullins
 
Sneak Peek into the New ChangeMan ZMF Release
Sneak Peek into the New ChangeMan ZMF ReleaseSneak Peek into the New ChangeMan ZMF Release
Sneak Peek into the New ChangeMan ZMF ReleaseSerena Software
 
American Family Insurance Case Study - Dreamers (1)
American Family Insurance Case Study - Dreamers (1)American Family Insurance Case Study - Dreamers (1)
American Family Insurance Case Study - Dreamers (1)Martha Nechvatal
 

Destaque (13)

Exec Statement
Exec StatementExec Statement
Exec Statement
 
online training for IBM DB2 LUW UDB DBA
online training for IBM DB2 LUW UDB DBAonline training for IBM DB2 LUW UDB DBA
online training for IBM DB2 LUW UDB DBA
 
The best Teradata RDBMS introduction a quick refresher
The best Teradata RDBMS introduction a quick refresherThe best Teradata RDBMS introduction a quick refresher
The best Teradata RDBMS introduction a quick refresher
 
My cool new Slideshow!
My cool new Slideshow!My cool new Slideshow!
My cool new Slideshow!
 
Spufi
SpufiSpufi
Spufi
 
DB2 V8 - For Developers Only
DB2 V8 -  For Developers OnlyDB2 V8 -  For Developers Only
DB2 V8 - For Developers Only
 
An Hour of DB2 Tips
An Hour of DB2 TipsAn Hour of DB2 Tips
An Hour of DB2 Tips
 
Vsam
VsamVsam
Vsam
 
Mvs commands
Mvs commandsMvs commands
Mvs commands
 
Mainframe – CONTROL-M
Mainframe – CONTROL-MMainframe – CONTROL-M
Mainframe – CONTROL-M
 
Sneak Peek into the New ChangeMan ZMF Release
Sneak Peek into the New ChangeMan ZMF ReleaseSneak Peek into the New ChangeMan ZMF Release
Sneak Peek into the New ChangeMan ZMF Release
 
American Family Insurance Case Study - Dreamers (1)
American Family Insurance Case Study - Dreamers (1)American Family Insurance Case Study - Dreamers (1)
American Family Insurance Case Study - Dreamers (1)
 
Jcl faqs
Jcl faqsJcl faqs
Jcl faqs
 

Semelhante a Job Control Language

Semelhante a Job Control Language (20)

SQL / PL
SQL / PLSQL / PL
SQL / PL
 
PLSQL Tutorial
PLSQL TutorialPLSQL Tutorial
PLSQL Tutorial
 
plsql les01
 plsql les01 plsql les01
plsql les01
 
Unit 3(rdbms)
Unit 3(rdbms)Unit 3(rdbms)
Unit 3(rdbms)
 
Unit 3(rdbms)
Unit 3(rdbms)Unit 3(rdbms)
Unit 3(rdbms)
 
10g plsql slide
10g plsql slide10g plsql slide
10g plsql slide
 
Unit 3
Unit 3Unit 3
Unit 3
 
L9 l10 server side programming
L9 l10  server side programmingL9 l10  server side programming
L9 l10 server side programming
 
Pl sql chapter 1
Pl sql chapter 1Pl sql chapter 1
Pl sql chapter 1
 
Functions oracle (pl/sql)
Functions oracle (pl/sql)Functions oracle (pl/sql)
Functions oracle (pl/sql)
 
plsql les02
 plsql les02 plsql les02
plsql les02
 
ORACLE PL/SQL
ORACLE PL/SQLORACLE PL/SQL
ORACLE PL/SQL
 
Analysing Performance of Algorithmic SQL and PLSQL.pptx
Analysing Performance of Algorithmic SQL and PLSQL.pptxAnalysing Performance of Algorithmic SQL and PLSQL.pptx
Analysing Performance of Algorithmic SQL and PLSQL.pptx
 
Chapter09
Chapter09Chapter09
Chapter09
 
Verilog Tasks and functions
Verilog Tasks and functionsVerilog Tasks and functions
Verilog Tasks and functions
 
Cursors, triggers, procedures
Cursors, triggers, proceduresCursors, triggers, procedures
Cursors, triggers, procedures
 
COBOL FOR FRESHER
COBOL FOR FRESHERCOBOL FOR FRESHER
COBOL FOR FRESHER
 
3963066 pl-sql-notes-only
3963066 pl-sql-notes-only3963066 pl-sql-notes-only
3963066 pl-sql-notes-only
 
Oracle notes
Oracle notesOracle notes
Oracle notes
 
PLSQLmy Updated (1).pptx
PLSQLmy Updated (1).pptxPLSQLmy Updated (1).pptx
PLSQLmy Updated (1).pptx
 

Último

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 

Último (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

Job Control Language

  • 1. JOB CONTROL LANGUAGE Complete Overview
  • 2. Session Objectives  To understand the  Job Control Language  Introduction  Overview  JOB, EXEC and DD (Data Definition) Statements  Syntax of the various statements  Execution process 2
  • 3. Sessions Outline  Session 1 : Introduction to JCL  Session 2 : JOB Statement  Session 3 : EXEC Statement  Session 4 : DD Statement  Session 5 : Job Processing Overview  Session 6 : Program Execution 3
  • 4. Introduction to JCL Session 1 4
  • 5. Job Control Language (JCL)  Describes to the operating system the work that has to be done and the resources required to do the work MVS 5
  • 6. Need for JCL OS Accounting Info Resources Program Region size Job details Priority JCL 6
  • 7. JCL Features  Consists of a set of statements called as Job Control Statements  Group of related JCL statements is known as Job  JCL consists of one or more Jobs  Job consists of Job steps to execute the instructions (tasks) 7
  • 8. Job Control Task  Job Control Tasks,  Entering Jobs  Processing Jobs  Requesting Resources are performed through,  JCL Statements  JES2 / JES3 Control Statements 8
  • 9. Job Entry Subsystem  Receive jobs into the operating system and schedule them for processing  Manages the output processing of the job (spooling)  JES2 and JES3 are the two JES types provided by IBM  JES2/JES3 subsystems are part of the OS that manages Batch jobs and Output 9
  • 10. Job Submission Process USER ACTIONS SYSTEM ACTIONS Determine Create Submit JES interprets the the the JCL & Passes Job JCL Job it to MVS System MVS does Messages the work JES Collects User views & the output & interprets the information about output the job 10
  • 11. JCL Statement Syntax Identifier field //NAME OPERATION OPERAND COMMENTS Name Operation Operand / Comment field field Parameter field field 11
  • 12. Identifier Field  Identifier field indicates to the system that a statement is a JCL rather than data  Code the Identifier field beginning in column 1  Consists of  Column 1 and 2 of all the JCL statements (//)  Column 1 2 and 3 of a JCL statement ( //* for comment)  Column 1 and 2 to mark end of data (/*) 12
  • 13. Name field  Identifies a particular statement so that the other statements and the system can refer it  Syntax  name should start in column 3  name is 1 through 8 alphanumeric  name should be followed by a blank  first character should be a alphabetic or national ( $, #, @) 13
  • 14. Operation Field  Specifies the type of the statement  Consists of characters in the syntax box for the statement  Follows the name field  Operation must be followed and preceded by at least one blank  Must begin on or before column 16 14
  • 15. Parameter or Operand Field  Also called as Operand field  Must end before column 62  Contains parameters separated by commas  Positional and Keyword Parameters. An eg. //RT452216 JOB 45992,CLASS=A  All positional parameters must precede all keyword parameters  Subparameters may be coded under Parameters to add further meaning to the statement An eg. //RT452216 JOB (45992,100,40),COND=(9,LT) 15
  • 16. Comment Field  Used to enter a comment in the output listing  Used to document a job and its resource requirements  Can be placed anywhere after the job statement  Appears as //* in Column 1, 2 and 3  Comment field can be coded till Column 80 16
  • 17. JCL Statements - Basics  Code the Operation, Operand and Comments fields in free form with at least one blank in-between  Code the Name field immediately after the Identifier without any blank column  All fields except for Operand must be separated by one blank  Only Columns 1 to 71 are used for JCL Content  Is case sensitive (Lower case not permitted) 17
  • 18. JCL Statements – Basics (Contd.)  Statements can be continued in the next line with // in 1 & 2 columns  The continued line must start between columns 4 and 16  Marking the end of the JCL is optional 18
  • 20. JCL Statements - Essential  Each Job is identified by a JOB statement that marks the beginning of a Job  Every job has one and only one job statement  Each Exec step is identified by an EXEC statement  EXEC (Execute) Statements follow the JOB Statement and has the name of the Programs / PROC’s to execute 20
  • 21. JCL Statements – Essential (Contd.)  Each Exec step may contain one or more control statements (DD statements) to describe resources required for the Job step  DD Statements describe each data set & request the allocation of I/O devices  Code the comment (//*) Statement to document the JCL  Code the delimiter (/*) Statement for marking the end-of-data for in-stream data 21
  • 22. JCL Statements - Optional  IF / THEN / ELSE / ENDIF Statement for selective execution of a Job Step  SET Statement assigns symbolic parameter values  INCLUDE Statement to copy JCL from a file into Job Stream  PROC & PEND Statements mark the beginning and end of a Procedure (Cataloged / in-stream)  JCLLIB Statement names the PROC & JCL Data set 22
  • 23. IF/THEN/ELSE/ENDIF  Used to conditionally execute job step with job  Examples: //NAME IF (RC GT 4) THEN To Test if RETURN-CODE > 4 //NAME IF (STEP10.RC GT 4) THEN To Test if RETURN-CODE from the Job Step STEP10 > 4 23
  • 25. SET Statement  Assign initial values to symbolic parameters  Change or Nullify the values of symbolic parameter  Syntax: //[NAME] SET symbolic-parameter=values  If there are more than one parameter, separate them by comma  Example: //SP1 SET PARM1=OLD,PARM2=22201  Parameter values containing special character enclosed by apostrophes  Example: //SP3 SET PARM1=‘2004-10-13’ 25
  • 26. INCLUDE Statement  Identify the member of a partitioned dataset containing the JCL statement  Syntax: //[NAME] INCLUDE MEMBER=name  INCLUDE group cannot contain  JOB Statement  PROC and PEND statement  JCLLIB statement  JES2 and JES3 statement  DD * and DD DATA statement 26
  • 28. Summary  What is JCL ?  Purpose of JCL  Structure of JCL - Examples  Coding Basics of JCL Statements  JCL Statements – Essential and Optional 28
  • 29. JOB Statement Session 2 29
  • 30. Session Coverage  Purpose of JOB Statement  Coding Syntax of JOB statements  Positional and Keyword parameters in a Job Statement  Examples 30
  • 31. Purpose of JOB Statement  Identifies a job to the OS using a job name  Indicates which user is responsible for the job  Tells the system how to process the job 31
  • 32. JOB Statement - Syntax • Operation Field Comment Field //Jobname JOB < parameters>..<comments> Name Field Operand Field (Job Name) 32
  • 33. JOB Statement - Name field //TRGR02Y JOB ....... Job name is TRGR02Y Job name is @TEST //@TEST JOB ....... 33
  • 34. JOB Statement - Operation field //MYJOB JOB ... JOB in Operation Field specifies it as Job statement //JOB1 JOB ... 34
  • 35. Parameter Field • //JOBNAME JOB <Parameters> • The following list shows the parameters on Job statement • ACCT-PARAMETER • PROGRAMMER NAME Positional Parameters • • CLASS COND • PRTY NOTIFY • MSGCLASS RESTART Keyword • MSGLEVEL ADDRSPC • REGION TIME Parameters • 35
  • 36. Positional Parameters  Job Statement can contain two positional parameters  First parameter should contain Accounting Information and the second parameter should contain the Programmer’s name  These two parameters are optional, but installation may define them as mandatory. 36
  • 37. Positional Parameters - Accounting Information  //JOB1 JOB (XYZ,TRG,3,DB2,123) ........... Accounting information  //JOB2 JOB (XYZ,DHC,1,DTX99,TRGG01) ...... 37
  • 38. Accounting Information in Real world  Five Fields - all are mandatory  Field1 - Group or Project  Field2 - Sub-Group or module or Project  Field3 - User-id  Field4 - Location (here type D2 or D1)  Field5 - Type of Job (Give DT99X)  Example for Training: (TRG,TRG,TRGG01,D2,DT99X) 38
  • 39. Positional Parameters - Programmer’s Name •  //JOB1 JOB (XYZ,TRG,3,DB2,123),TRAINING....... 2nd positional parameter- Accounting parameter programmer's name  //JOB2 JOB (XYZ,DH,1,DTX99,TRGR01),’XYZ TRG’.  //JOB3 JOB ,’Shane o’’Hara’..... Programmer's name parameter in quotes No accounting Enclose programmer‘s name within parameter apostrophe if it contains special character 39
  • 40. Key Word Parameters The Job Statement (or Job Card) can contain the following Keyword parameters  CLASS  PRTY  TIME  ADDRSPC  REGION  MSGCLASS  MSGLEVEL  NOTIFY  COND  RESTART  TYPRUN 40
  • 41. Keyword Parameters - CLASS  Syntax:  CLASS=<job class>  Examples:  //JOB1 JOB ACCT1,CLASS=A..  //JOB2 JOB ACCT1,CLASS=B.... JOB1 IS ASSIGNED TO CLASS A  //JOB3 JOB ACCT1,CLASS=C.... JOB2 IS ASSIGNED TO CLASS B  //JOB4 JOB ACCT1,CLASS=D.... JOB3 IS ASSIGNED TO CLASS C JOB4 IS ASSIGNED TO CLASS D 41
  • 42. Class Definitions in Real world Installation  Class A -- 2 sec  Class B -- 7 sec  Class C -- 19 sec  Class D -- 46 sec  Class E -- 5 mins  Class H -- Held Class  Class T -- 5 mins (for tapes only)  Class R -- 5 mins. (cartridges only)  Time specified are CPU time 42
  • 43. Keyword Parameters - TIME  Syntax: Allows this job to use 2 min  TIME=([minutes][,seconds]) 30 sec of CPU time  Examples:  //JOB1 JOB ACCT1,CLASS=E,TIME=(2,30).... Allows this job to use 30 sec of CPU time  //JOB2 JOB ACCT1,CLASS=E,TIME=(,30)...  //JOB3 JOB ACCT1,CLASS=E,TIME=2.... Allows this job to use 2 mins of CPU time 43
  • 44. Keyword Parameters – TIME (Contd.)  Syntax:  TIME=([1440]| [NOLIMIT] | [MAXIMUM])  Examples:  //JOB4 JOB ACCT1,CLASS=E,TIME=1440....  //JOB5 JOB ACCT1,CLASS=E,TIME=NOLIMIT.... These jobs can use the processor for unlimited amount of time  //JOB6 JOB ACCT1,CLASS=E,TIME=MAXIMUM.... This job can run for maximum amount of time that is 357912 minutes. 44
  • 45. Keyword Parameters - PRTY  To assign the selection priority to the JOB  Syntax:  PRTY=(number)  Examples:  //JOB4 JOB ACCT1,CLASS=E,PRTY=12... 45
  • 46. Keyword Parameters - REGION  Syntax:  REGION={valueK | valueM}  Examples:  //JOB1 JOB ACT1,CLASS=A,ADDRSPC=REAL,REGION=200K. Specifies 200 kilo bytes of  //JOB2 JOB ACT1,’TRG’,CLASS=A,REGION=20M. central storage is required for this job(JOB1)  Specifies 20 mega bytes of virtual storage is required for  this job(JOB2) 46
  • 47. Keyword Parameters - ADDRSPC  Syntax: ADDRSPC={REAL | VIRT}  Examples: //JOB1 JOB ACT1,CLASS=A,ADDRSPC=REAL,REGION=20K Non pageable central storage of 20k is required for this job(JOB1) //JOB1 JOB ACT1,CLASS=A,ADDRSPC=VIRT,REGION=20K Pageable virtual storage of 20k is required for this job(JOB1) 47
  • 48. Keyword Parameters - MSGCLASS  Syntax: MSGCLASS=<class>  Examples: //JOB1 JOB (XYZ,TRG,3,,123),’TRG GROUP’, // CLASS=B,MSGCLASS=X... //JOB2 JOB (XYZ,TRG,3,,123),’TRG GROUP’, // CLASS=B,MSGCLASS=A... 48
  • 49. Keyword Parameters - MSGLEVEL  Details in the listing of Joblog can be controlled, using MSGLEVEL parameter  Syntax: MSGLEVEL=([statements][,messages])  Job log contains the following information :  JCL Statements  Procedure Statements for any procedure job step calls  Messages about Job control statements, allocation of devices and volumes, execution and termination of job steps and disposition of datasets 49
  • 50. Keyword Parameters - MSGLEVEL • Statements - Controls the listing of JCL statements in Job log • 0 - The system prints the JOB statement, comments • and all statements up to the first EXEC • statement • 1 – The system prints all the JCL statements, control • statements, Procedure statements and values • assigned to symbolic parameter’s • 2 – The system prints all the JCL statements and control statements 50
  • 51. Keyword Parameters - MSGLEVEL • Messages - To control the listing of JCL and JES • messages in Job log • 0 – The system prints only the JCL messages • 1 – The system prints, JCL, operator and SMS • messages 51
  • 52. Statements sub-parameter - MSGLEVEL  MSGLEVEL=([statements][,messages]) Only job statement is printed for job(job1)  //JOB1 JOB AC1,MSGCLASS=X,MSGLEVEL=(0,1)..  NO parentheses ??  //JOB2 JOB AC1,MSGCLASS=X,MSGLEVEL=2.. Both Statements and Messages are printed  //JOB3 JOB AC1,MSGCLASS=X,MSGLEVEL=(1,1) 52
  • 53. Messages sub-parameter - MSGLEVEL  MSGLEVEL=([statements][,messages]) Only JCL messages are printed for job(job1)  //JOB1 JOB AC1,MSGCLASS=X,MSGLEVEL=(0,0)..  No value for messages Sub-parameter. Takes  //JOB2 JOB ACC1,MSGCLASS=X,MSGLEVEL=2.. default. All messages are printed  //JOB3 JOB AC1,MSGCLASS=X,MSGLEVEL=(,1) 53
  • 54. Keyword Parameters - NOTIFY  Syntax:  NOTIFY=<user-id> or  NOTIFY=<nodeid.userid> or  NOTIFY=<&SYSUID> User-id TRGG01 is notified  Examples: after completion of this job  //JOB1 JOB ACCT1,CLASS=A,NOTIFY=TRGG01..  //JOB2 JOB ACCT1,NOTIFY=XYZMN03.TRGG02.. User-id TRGG02 at XYZMN03 is Notified after completion of this job 54
  • 55. Keyword Parameters - TYPRUN  Syntax:  TYPRUN={HOLD|SCAN} Checks job’s JCL for syntax errors.  Examples: Job is not submitted for execution //JOB1 JOB ACCT1,MSGCLASS=X,TYPRUN=SCAN.. //JOB2 JOB ACCT1,MSGCLASS=X,TYPRUN=HOLD.. This job waits for execution until operator releases it for execution 55
  • 56. Keyword Parameter - RESTART  Syntax:  RESTART={* } Restart job at first job step itself  {stepname}  {stepname.procstepname}  Stepname:  indicates the job step from which to restart the job  Stepname.procstepname:  stepname refers to the EXEC statement of the jobstep that calls the procedure.  Procstepname refers to the EXEC statement of the procedure step.  If the stepname refers to the EXEC statement in a procedure then procedure name is also specified. 56
  • 57. Keyword parameter - RESTART  Example: //JOB1 JOB ACCT1,MSGCLASS=X,RESTART=COUNT.. Restart from step COUNT //JOB1 JOB CCT1,MSGCLASS=X,RESTART=PROC1.COUNT.. Restart from step COUNT in procedure step PROC1 57
  • 58. JOB Statement Examples  Example 1 : //TRGG02X JOB (TRG,GEN,TRGG02,AA,DT99X),’TRG’, // CLASS=B,MSGCLASS=X,NOTIFY=TRGG02  Example 2 : //GEMT01XX JOB (GEM,CIC,GEMT01,D2,DT99X), // ‘GEM-PROJ’,CLASS=C,MSGLEVEL=(1,1), // MSGCLASS=X,NOTIFY=GEMT01 58
  • 59. Summary  The purpose of the JOB statement  Coding Syntax of JOB statement  Various options for the Positional and keyword parameters  Examples of JOB statement 59
  • 60. EXEC Statement Session 3 60
  • 61. Session Coverage  Purpose of Exec Statement  Coding Syntax of Exec statements  Positional and Keyword parameters in an Exec Statement  Examples 61
  • 62. Purpose of Exec Statement  Used to specify which program or procedure an individual job step has to execute  Tells system how to process the job step 62
  • 63. Exec Statement: Example OS Processing parameters Beginning of step Parameters to program JCL Program or Proc name //JOB1 JOB AC1, // CLASS=A //ST1 EXEC PGM=P1, // PARM=‘04/11/01’. // REGION=800K // ..... DD .. // 63
  • 64. EXEC Statement in JCL • //JOB1 JOB .... • Beginning of JOB • //ST1 EXEC PGM=P1 • Beginning of step ST1 • //INPUT DD ..... • Statements that follow the Exec step ST1 • ............. • • ............. • • //ST2 EXEC PGM=P2 • Beginning of step ST2 • //INPUT DD ..... • Statements that follow the Exec step ST2 • .......... • • // • End of Job 64
  • 65. EXEC STATEMENT - Syntax • Operation Field Comment Field //Stepname EXEC < parameters>.. <comments> Name Field Parameters Field 65
  • 66. Operation field //MYSTEP EXEC ... EXEC in Operation Field specifies it as Exec statement //STEP1 EXEC ... 66
  • 67. Parameter Field • //STEPNAME EXEC <Parameters> • The following list shows the important parameters on Exec statement • PROGRAM NAME • (PGM= or PROC=) Positional Parameter • ACCT PARM • ADDRSPC REGION • TIME COND Keyword Parameters 67
  • 68. Positional Parameters  Syntax: PGM=<program name> OR PROC=<procedure name> OR <procedure name>  Examples: //STEP1 EXEC PGM=TEST STEP1 executes program TEST //STEP2 EXEC PROC=COMPILE //STEP3 EXEC COMPILE STEP2 & STEP3 invokes JCL procedure COMPILE 68
  • 69. Key Word Parameters The EXEC statement can contain the following Keyword parameters :  ACCT •  PARM  ADDRSPC  REGION  TIME  COND 69
  • 70. Key word Parameters  ACCT – provides accounting information for the job step  ADDRSPC – prevents the step from being paged  REGION - specifies the region size to allocate to a job step  TIME - imposes a CPU time limit on the job step 70
  • 71. Keyword Parameter - PARM  Syntax: PARM=(<sub parameter,[sub parameter]>)  Examples: 25/01/01 is enclosed in apostrophes because it contains //STEP1 EXEC PGM=P1,PARM=TRGXYZ special characters ‘/’ //STEP2 EXEC PGM=P2,PARM=(10,’25/01/01’) //STEP3 EXEC PGM=P3,PARM=‘25&&45’ Passes string 25&45 to program P3 71
  • 72. Program Execution using PARM JCL for executing program CP1 Cobol Program-CP1 • //JOB1 JOB ACCT1,TRG-GRP, • // CLASS=B,NOTIFY=TRG???, • IDENTIFICATION DIVISION. • // MSGCLASS=X • ENVIRONMENT DIVISION. • //*This is to demonstrate • DATA DIVISION. passing • WORKING STORAGE SECTION. • //* parameters to program • LINKAGE SECTION. thru JCL • //STEP1 EXEC PGM=CP1, • 01 WS-DATE • // PARM=‘31/03/01’ • 05 WS-CTRL-LEN PIC S9(4) • // ...... ...... ..... COMP SYNC. • // • 05 WS-CTRL-DATE X(8). • //*This JCL executes • PROCEDURE DIVISION USING program CP1 • WS-DATE. 72
  • 73. Keyword Parameter - COND  Syntax:  COND=(code,Operator[,step name]) [,EVEN | ONLY]  Examples: //STP1 EXEC PGM=P1,COND=(0,NE) If any preceding step returns non zero return code this step is bypassed //STP2 EXEC PGM=P2,COND=(4,LT,STP1) If step STP1 returns a code less than or equal to 4 then this step is executed else bypassed. 73
  • 74. Keyword Parameter- COND  Examples: //STP1 EXEC PGM=P1,COND=EVEN STP1 is executed even if a preceding step abends //STP2 EXEC PGM=P3,COND=((4,LE,STP1),ONLY) STP2 is executed only if a preceding step abends and return code of STP1 is less than 4 74
  • 75. Relational Operators for COND Rt r c d ( C f o jutc ml t dse eun o eR ) r m s o pee t p c n pr mt r o d aa ee c ni u j bi o tn e o f t r i aej bi em t o f n C N =c d,G) R > c d O D( o e T C =o e R <o e Cc d C N =c d,G) R >o e O D( o e E Cc d R <c d C=o e C N =c d,E ) R ! c d O D( o e Q C =o e R =o e Cc d C N =c d,L ) R < c d O D( o e T C=o e R >o e Cc d C N =c d,L ) R <o e O D( o e E Cc d R >c d C=o e C N =c d,N) R =o e O D( o e E Cc d R! cd C=o e 75
  • 76. COND Parameter with Return Codes • Job requiring special Conditional execution • ABOUT SELECT PROGRAM. STP1 If Step • SELECT PROGRAM : SELECT ABENDS • RETURNS - 0, IF AT LEAST ONE RECORD IS SELECTED FOR PROCESSING BY UPDATE STP3 PROGRAM. RC ABDMP END • RETURNS - 12, IF NO RECORDS 12 ARE SELECTED FOR 0 PROCESSING BY UPDATE If Records Exist PROGRAM. to Process STP2 If Step END UPDATE ABENDS 76
  • 77. COND Parameter with Return Codes (Contd.)  JCL for executing JOB described in the previous slide //JOB1 JOB ACT1,TRG,CLASS=B,NOTIFY=TRGXXX //STP1 EXEC PGM=SELECT ..... ...... DD STATEMENTS...... //STP2 EXEC PGM=UPDATE,COND=(12,LE,STP1) ..... ...... DD STATEMENTS...... //STP3 EXEC PGM=ABDMP,COND=ONLY ..... ...... DD STATEMENTS...... // 77
  • 78. EXEC Statement Examples • //TRGR02XX JOB (TRG,GEN,TRGR02,AA,DT99X), • // ‘TRG’,CLASS=B,NOTIFY=TRGR02,MSGCLASS=X • //ALLOC EXEC PGM=IEFBR14  This step allocates data sets • .... ........ .......... .......... .... • //COB EXEC PGM=IGYCRCTL,COND=(4,LT),  This step compiles a program • // PARM=‘NUM,SOURCE,LIB,RES’, • // REGION=2048K • .... ........ .......... .......... .... • //STPZ EXEC PGM=IEWL,PARM=‘REUS,LET’,  This step does link editing • // COND=((4,LT,COB),(4,LT,ALLOC)) • .... ........ .......... .......... .... • // 78
  • 79. DD statement in EXEC cont.... • DD statement in EXEC statement is optional. DD statement is used for specifying any input to the program or to specify where the output is to be printed. If there is no input file and if there is no need of output, then we can ignore the DD statement in EXEC part. • System generation programs and the programs that are in system library syslib and proclib can be executed by using EXEC statement without a DD statement. •Eg: //TRGRXX JOB 'MVS-MVS-U237011-Z9-DT08X',REGION=2096K • //IKJACCNT EXEC IKJACCNT • Once you login the mainframes region, the above job will start executing automatically, this needs no DD statement. 79
  • 80. Summary  The purpose of the Exec statement  Coding Syntax of Exec statement  Various options for the Positional and keyword parameters  Examples of Exec statement 80
  • 82. Session Coverage  Purpose of DD Statement  Coding Syntax of DD statements  Temporary data sets  DASD data sets  Instream and SYSOUT data sets  Examples 82
  • 83. Purpose of DD Statement • OS I/P & O/P data sets Program location Data set integrity Constraints Input data Resources required by job & processing program DD Statements 83
  • 84. DD Statement in JCL • //JOB1 JOB ACT1,NOTIFY=TRGXXX • //STEP1 EXEC PGM=P1 • //DD1 DD ... • //DD2 DD ... DD statements for step STEP1 • .... • //STEP2 EXEC PGM=P2 • //INDD DD ... DD statements for step STEP2 • //DD2 DD ... • .... • // 84
  • 85. DD Statement - Syntax • Operation Field Comment Field //ddname DD < parameters>.. <comments> Name Field Key word Parameters Field (DD Name) 85
  • 86. Keyword Parameters for DASD datasets • //ddname DD DSNAME=dataset name • ,DISP=file’s status • [ ,UNIT=device where the file exists ] • [ ,VOL=SER=serial number of the volume ] • [ ,SPACE=DASD space to be allocated ] • [ ,DCB=Options for file’s data control block ] 86
  • 87. DSNAME Parameter  DSN Parameter specifies the Physical file name to be associated with the DD Name referred by processing program or system. DD Name Data set name in DSN LOGICAL FILES NAME or PHYSICAL DATA SET DD NAME - Referred by For the DD name referred processing program or system by program or system 87
  • 88. DSNAME Parameter  Syntax: DSN=<data set name> | <DSNAME(member)>| NULLFILE  Dataset name can be :  Qualified data set name  Unqualified data set name  NULLFILE  PDS member name  Temporary data set name 88
  • 89. DSNAME Parameter : Examples  Qualified data set name //INFILE DD DSN=TRGXX.SRC.COBOL, .....  Unqualified name as data set name //DD1 DD DSNAME=TRGXX, ......  Data set name for a Dummy Data set //OUTFILE DD DSN=NULLFILE  Member of a PDS as data set name(qualified data set name) //INFILE DD DSN=TRGXX.SRC(MEM1) ..... 89
  • 90. Temporary Dataset  Syntax: DSN=&&<data set name>  Dataset exists only during the execution of job. Usually called as Work files.  Always deleted at the end of job  Resides in Virtual Storage  Compound DSN, joined by period not allowed in temporary dataset 90
  • 91. Temporary Dataset : Example 91
  • 92. DD Statements in relation with programs Cobol Program-CP1 JCL for executing program CP1 • IDENTIFICATION DIVISION. • //JOB1 JOB ACCT1,TRG-GRP, • ENVIRONMENT DIVISION. • // CLASS=B,NOTIFY=TRG???, • SELECT INPUT ASSIGN TO • //STEP1 EXEC PGM=CP1 • INDD. • //INDD DD ...... • SELECT OUTPUT ASSIGN TO • //OUTDD DD ....... • OUTDD. • // • DATA DIVISION. • //*This is to demonstrate • WORKING STORAGESECTION. relation between program ddnames names to ddnames in • PROCEDURE DIVISION....... JCL. ...... ....... • //*This Run JCL for program CP1 92
  • 93. DISPOSITION Parameter - DISP  Syntax: DISP=<([current status][,normal termination DISP] [,abnormal termination DISP])> CURRENT NORMAL ABNORMAL STATUS TERMINATION TERMINATION NEW DELETE DELETE OLD KEEP KEEP SHR PASS CATLG MOD CATLG UNCATLG UNCATLG 93
  • 94. DISP-Current Status : Examples  Sharing the already existing data set. //INFILE DD DSN=TRGXX.SRC(MEM1),DISP=SHR  Exclusive control over already existing data set or writing to existing data set. Existing records will be deleted. //OUTFILE DD DSN=TRGXX.OUT,DISP=OLD  Creating new data set. //NEWDD DD DSN=TRGXX.NEW,DISP=NEW........  For updating the existing data set in exclusive access mode and is positioned at the end of the data, so the records may be added to the end. //DD1 DD DSN=TRGXX.TRN,DISP=MOD ..... 94
  • 95. DISP-Normal Termination : Examples  Request to keep the data set on normal completion of step. //INFILE DD DSN=TRGXX.SRC,DISP=(SHR.KEEP)  To delete the data set on normal completion of step. //OUTFILE DD DSN=TRGX.OUT,DISP=(OLD,DELETE)  To catalog the data set on normal termination of step. //NEWDD DD DSN=TRGX.NEW,DISP=(NEW,CATLG)  To pass data set for use by subsequent step on normal termination of step. //DD1 DD DSN=TRGXX.TRN,DISP=(MOD,PASS) 95
  • 96. DISP-Abnormal Termination : Examples  To Keep the data set on abnormal completion of step. //FILE1 DD DSN=TRGX.SRC,DISP=(SHR,PASS,KEEP)  To Uncatalog the data set on abnormal completion of step. //OUT1 DD DSN=TRGX.OUT,DISP=(OLD,,UNCATLG)  To Catalog the data set on abnormal termination of step. //NEWDD DD DSN=TRGX.NEW,DISP=(NEW,,CATLG)  To Delete data set on abnormal termination of step. //DD1 DD DSN=TRGXX.TRN,DISP=(,PASS,DELETE) 96
  • 97. DISP Parameter - Defaults • DISP coded on DD statement System Interpretation • by default • NO DISP PARAMETER DISP=(NEW,DELETE,DELETE) • DISP=SHR DISP=(SHR,KEEP,KEEP) • DISP=OLD DISP=(OLD,KEEP,KEEP) • DISP=(,CATLG) DISP=(NEW,CATLG,CATLG) • DISP=(OLD,,DELETE) DISP=(OLD,KEEP,DELETE) • DISP=MOD (Treated as new) DISP=(MOD,DELETE,DELETE) • DISP=MOD (Treated as old ) DISP=(MOD,KEEP,KEEP) 97
  • 98. Parameters to Define Location of Datasets  UNIT  Specifies the physical device where an existing dataset can be found or where a new one can be found  Specify only installation defined group of devices  VOLUME  Specifies the volume serial number of the particular tape or disk involved  Volume parameter is optional for new datasets  For Cataloged datasets, Unit and Volume details need not be specified 98
  • 99. UNIT Parameter  Syntax: UNIT=({[device-number][device-type] [group-name]} {[,unit-count] [,P]} [,DEFER] ) or UNIT=AFF=ddname  Examples: //DD1 DD DSN=TRG1.U1,DISP=(NEW,KEEP), // UNIT=3380 device-type //DD2 DD DSN=TRG1.U,UNIT=SYSDA group name 99
  • 100. UNIT Parameter • //DD1 DD DSN=TRG1.U1,DISP=MOD, • // UNIT=(3390,2) 2 devices are requested • //DD2 DD DSN=TRG1.U,DISP=SHR, • // UNIT=(,,DEFER) request to defer mounting • //DD3 DD DSN=TRG1.AFF,DISP=OLD, • // UNIT=AFF=DD1 requests same two devices as • Step DD1 100
  • 101. VOLUME Parameter  Syntax: VOLUME= ([PRIVATE] [,RETAIN] [,vol-seq-number] [,vol-count] [,{SER=(ser-no[,ser-o]..)} {REF=dsname}{REF=*.ddname}] ) 101
  • 102. VOLUME Parameter : Examples • //IN DD DSN=TRG.V1,DISP=(,KEEP),SPACE=(TRK,10). • // VOLUME=(PRIVATE,SER=WORK01) • //OUT1 DD DSN=TRG.V2,DISP=SHR, • // VOLUME=(,RETAIN,2) • //OUT2 DD DSN=TRG.V3,DISP=NEW,SPACE=(1024,10), • // VOLUME=(,RETAIN,,2,SER=(DEV01,DEV02)) 102
  • 103. VOLUME Parameter : Examples • //IN DD DSN=TRG.V1,DISP=(,KEEP),SPACE=(TRK,10), • // VOLUME=(,RETAIN,REF=TRG.V1) • //OUT1 DD DSN=TRG.V2,DISP=SHR, • // VOLUME=SER=DEV01 • //OUT2 DD DSN=TRG.V3,DISP=NEW,SPACE=(1024,10), • // VOLUME=REF=*.OUT1 103
  • 104. SPACE Parameter  Syntax: SPACE= ({TRK,}(prqty[,secqty][,dir])[,RLSE][,CONTIG][,ROUND]) {CYL,} {blklen,} Number of Units Special Processing Requests Measurement Unit 104
  • 105. DCB Parameter  DCB to define the Characteristics of individual data sets.  Syntax: DCB=(LRECL=nn[,BLKSIZE=yy][,RECFM=zz] [,DSORG=mm]) nn - Logical Record Length yy - Block size zz - Record Format (F,FB,V,VB or U) mm - Data Set Organization (PS or PO) 107
  • 106. DCB Parameter : Examples  DCB for new PS data set with fixed record length of 80 with blocking(block contains 10 records) //DD1 DD DSN=TRG.DCB,DISP=(NEW,CATLG), // DCB=(LRECL=80,RECFM=FB,BLKSIZE=800), // SPACE=(TRK,(5,5))  DCB for new PDS data set with variable record length of 80 and no blocking.. //DD1 DD DSN=TRG.DCB,DISP=(NEW,CATLG), // DCB=(LRECL=80,RECFM=V,DSORG=PO), // SPACE=(TRK,(5,5,2)) 108
  • 107. DD Statement for Instream data sets  Syntax: //ddname DD (*) [ ,DLM=xx ] (DATA)  Programs will treat the instream data as if it comes from a sequential file of 80-Character records  JES will copy the instream data to a spool volume  Processing program can retrieve data from spool volume as it executes 109
  • 108. Instream data sets : Examples  Example 1: //INDATA DD * Bh009189lk56 Akp0789mjirm /*  Example 2: //INDATA DD DATA,DLM=@@ //STEP1 EXEC PGM=INPROG //INPFIL DD SYSOUT=A /* 110
  • 109. DD Statement for SYSOUT data sets  Syntax: //ddname DD SYSOUT=x  Example: //SYSPRINT DD SYSOUT=A  The SYSOUT parameter  indicates that the data set should be processed by JES2/JES3  Specifies the output class associated with the data set 111
  • 110. DD Statements for Execution related Data sets  Specifying private program library  JOBLIB  STEPLIB  Specifying dump data set 112
  • 111. Specifying Private Program libraries  Private libraries are specified to execute programs that do not reside in the system libraries  Job library applies to entire job  Step libraries applies to only one step in a job  If both JOBLIB and STEPLIB DD statements are coded, step library is searched first (Job library ignored for that job step) 113
  • 112. JOBLIB : Example • //MM01E JOB (36512),'LE MENENDEZ',NOTIFY=MM01 • //JOBLIB DD DSNAME=MMA.TEST.LOADLIB,DISP=SHR • //STEP1 EXEC PGM=IEBGENER • . • . • //STEP2 EXEC PGM=ORD2200A • . • . 114
  • 113. STEPLIB : Example • //MM01F JOB (36512),'LE MENENDEZ',NOTIFY=MM01 • //STEP1 EXEC PGM=IEBGENER • . • . • //STEP2 EXEC PGM=ORD2200A • //STEPLIB DD DSNAME=MM01.TEST.LOADLIB,DISP=SHR . • . • . 115
  • 114. Specifying Dump data set  Storage dump is the content of the virtual storage used by the program before the job terminates with error  To obtain storage dump, code DD statement named SYSUDUMP, SYSABEND, or SYSMDUMP  Syntax: //SYSDUMP DD SYSOUT=*  If a job step ends normally, the dump DD statement is ignored 116
  • 115. Summary  The purpose of the DD statement  Coding Syntax of DD statements for  Temporary data sets  DASD data sets  Instream data sets  SYSOUT data sets  Dataset Attributes  DD Statements to specify private library data sets and dump data sets 117
  • 116. In-Stream and Cataloged Procedures • • As you gain more experience in submitting jobs, you will find that you often use the same set of job control statements repeatedly with little or no change. • • To save time and prevent errors, you can prepare sets of job control statements that you can execute again and again. You can do this through the use of two types of procedures: in-stream procedures and cataloged procedures. 118
  • 117. In-Stream procedure • An in-stream procedure is a named set of job control statements in a job that can be re-executed within that job, simply by invoking the name of the procedure. • This enables you to execute the set of control statements more than one time in the same job without having to repeat the statements. • The maximum number of in-stream procedures you can code in any job is 15. 119
  • 118. Example .. • Job Control Statement Explanation • //JOB1 JOB CT1492,'JIM MOSER' Starts job • //PTEST PROC Starts in-stream procedure • //PSTA EXEC PGM=CALC Identifies first step in procedure • //DDA DD DSNAME=D.E.F,DISP=OLD Request 3 data sets for first procedure step • //DDB DD DSNAME=DATA1,DISP=(MOD,PASS) • //DDOUT DD SYSOUT=* • //PSTB EXEC PGM=PRNT Identifies second step in procedure • //DDC DD DSNAME=*.PSTA.DDB,DISP=OLD Request 2 data sets for second procedure step • //DDREP DD SYSOUT=A • // PEND Ends in-stream procedure • //STEP1 EXEC PROC=PTEST First step in JOB1, executes procedure • //PSTA.IN DD * Adds in-stream data to procedure step • . PSTA • (data) • . • /* • 120
  • 119. Cataloged Procedure • A cataloged procedure, like an in-stream procedure, is a named set of job control statements. However, these control statements are placed, or cataloged, in a partitioned data set (PDS) known as a procedure library. This enables a cataloged procedure to be invoked by any job. • Cataloged procedures can be placed in the system procedure library SYS1.PROCLIB or in any user-specified procedure library (for example JCLLIB). 121
  • 120. Example... • Job Control Statement Explanation • //MYPROC PROC Starts cataloged procedure • //MY1 EXEC PGM=WORK1 Identifies first step in procedure • //MYDDA DD SYSOUT=A Request 2 data sets for first procedure step //MYDDB DD SYSOUT=* //MY2 EXEC PGM=TEXT5 Identifies second step in procedure • //MYDDC DD DSNAME=F.G.H,DISP=OLD Request 2 data sets for second procedure step //MYDDE DD SYSOUT=* // PEND Indicate end of procedure • Job Control Statement Explanation • //JOB2 JOB ,'JACKIE DIGIAN' Starts job • //STEPA EXEC PROC=MYPROC First step in JOB2, executes procedure • //MY2.MYDDC DD DISP=(OLD,DELETE) Modifies DD statement MYDDC in procedure step MY2 122
  • 121. Job Processing Overview Session 5 123
  • 122. Job Processing • Input Conversion Errors Phase Phase No Yes Output Execution Phase Phase Error Details Phase Purge End Phase Job 124
  • 123. JES (Job Entry Subsystem)  Internal Readers JES2/JES3 handles the Input Processing  JES will select from the initiator, the highest priority job classes to run  Initiator allocates the resources required for the job 125
  • 124. Conversion Processing  Conversion processing  assigns a job number to the job  analyzes the JCL statements  merges in any cataloged procedures which they reference  converts the JCL into "internal text", which is meaningful to JES and the MVS job scheduler  checks for syntax errors  invokes various user exits  if no errors are found, the converter stores the internal text on the "spool" dataset and adds the job to the input queue 126
  • 125. Execution Processing  JES2 keeps track of each job by building a Job Queue Element  On the Queue, job is selected by  Is initiator available for this job class  If more than 1 class for the initiator, then select in order of class  Is the priority of the job highest in the queue for this job class  At the completion of the job, JES places the job in output queue 127
  • 126. Spooling Simultaneous Peripheral Operations On Line  Spool is a buffer that holds O/P for printers and process instructions as devices become available  As one task is waiting for resource, the next one is taken for execution  All output to spooled devices is first written to disk  Spooled O/P is then stored and scheduled until the printer is available 128
  • 127. Output/Print/Purge Processing  JES2 processes SYSOUT data sets either when job ends or data set is closed  O/P datasets are written to Print files in JES2 SPOOL  The Print Processors selects the job by priority within class and print output  Once job processing is completed, the access space released and job number becomes available for a new job 129
  • 128. Input-Conversion-Execution : Summary • Spool JCL Input Phase Input Queue Conversion Job Proclib Phase Queue Execution Output Queue Phase 130
  • 129. Program Execution Session 6 131
  • 130. Fundamentals  Modular programming:  Aims to split a problem into small, manageable units of work (modules).  Source module:  Program written in a symbolic language.  Forms the input to a language translator.  Object module:  The output from a language translator.  Forms the input to the linkage editor.  An object module may, however, be directly executed via the Loader.  Load module:  The output from the linkage editor; it is in a readily executable format. 132
  • 133. DD Names for compile-link-go • procedures COBOL Compile Step DD names • SYSIN - Source program input for the COBOL compiler. • SYSLIB - The copy library or libraries. • SYSLIN - Object module output. • SYSPRINT- Print Data set • Link-edit Step DD names • SYSLIB - The subprogram library or libraries. • SYSLIN - Object module input. • SYSIN - Additional object module input. • SYSLMOD - Load module output. • Execute (run) step DD names • SYSOUT - Output from DISPLAY statements. • SYSDBOUT - Symbolic debugging output. • SYSABEND/SYSUDUMP- Abnormal termination (or storage dump) output. 135
  • 134. Linkage-editor Parm Options  LIST - lists the linkage-editor control statements  MAP - produces a storage map showing the length and relative locations of all control sections.  XREF - includes MAP plus a cross-reference table of the load module.  AMODE - value specifies whether the program uses 24- or 31- or 64- bit addressing  RMODE - value indicates where in Virtual Storage, the program must be loaded (24 or ANY) 136
  • 135. Sample Compilation Job steps • //COMP EXEC PGM=IGYCRCTL, • // PARM='SOURCE,APOST,MAP,LIST,LIB,NOCMPR2,XREF,FDUMP' • //* • //STEPLIB DD DSNAME=IGY.V2R1M0.SIGYCOMP,DISP=SHR • //SYSIN DD DSN=&SRCE(&MEMBER),DISP=SHR • //*SYSLIB DD DSN=copy-book-dataset-name,DISP=SHR • //SYSPRINT DD SYSOUT=* • //SYSLIN DD DSN=&&LOADSET,DISP=(NEW,PASS), • // SPACE=(10,(25,5),,,ROUND),UNIT=3390 • //SYSUT1 DD UNIT=VIO,SPACE=(CYL,(1,1)) • //* 137
  • 136. Sample Link Edit Job steps  Example on multiple load module processing //LKED EXEC PGM=IEWL, // PARM='AMODE=31,RMODE=ANY,TEST,LIST, // XREF,LET,MAP',REGION=512K //SYSLIB DD DSNAME=CEE.SCEELKED,DISP=SHR // DD DSNAME=CEE.SCEERUN,DISP=SHR //LIB1 DD DSN=TRG1T.TEST.DSN1,DISP=SHR //LIB2 DD DSN=TRG1T.TEST.DSN2,DISP=SHR //SYSLMOD DD DSN=TRG1T.TEST.LOAD,DISP=SHR //SYSUT1 DD SPACE=(1024,(50,50)),UNIT=VIO //SYSPRINT DD SYSOUT=* //SYSLIN DD DSN=&&LOADSET,DISP=(OLD,DELETE) // DD DDNAME=SYSIN //SYSIN DD * NAME LOAD1(R) INCLUDE LIB1(MEM1,MEM2,MEM3) NAME LOAD2 /* 138
  • 137. Sample Run Job • //STEP1 EXEC PGM=TEST • • //STEPLIB DD DSN=TRG1T.COBOL.LOAD,DISP=SHR • //DTXN DD DSN=TRG1T.COBOL.PGM,DISP=(SHR,KEEP) • //SYSOUT DD SYSOUT=* • //SYSDBOUT DD SYSOUT=* • //SYSABOUT DD SYSOUT=* • //SYSIN DD DUMMY 139
  • 138. Summary  The Compilation-Linkedit and execution procedure  DD Statements involved in Compile-Linkedit-Run steps  Sample Compilation and Linkedit jobs  Sample Run JCL 140
  • 139. References  z/OS V1R3.0 MVS JCL Reference - Redbook  z/OS V1R2.0 MVS JCL User's Guide – Redbook  Murach’s Os/390 and z/OS JCL by Raul Menendez and Doug Lowe 141
  • 140. THANK YOU 142