JOB CONTROL LANGUAGE  Complete Overview
Session Objectives To understand the    Job Control Language        Introduction        Overview    JOB, EXEC and DD ...
Sessions Outline Session 1 : Introduction to JCL Session 2 : JOB Statement Session 3 : EXEC Statement Session 4 : DD S...
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 ...
Need for JCL                OSAccounting Info    Resources                    Program  Region size                  Job de...
JCL Features Consists of a set of statements called as Job Control Statements Group of related JCL statements is known a...
Job Control Task Job Control Tasks,     Entering Jobs     Processing Jobs     Requesting Resources   are performed thr...
Job Entry Subsystem Receive jobs into the operating system and schedule them for processing Manages the output processin...
Job Submission Process            USER ACTIONS                                            SYSTEM ACTIONSDetermine       Cr...
JCL Statement SyntaxIdentifier  field   //NAME      OPERATION    OPERAND     COMMENTS      Name      Operation   Operand /...
Identifier Field Identifier field indicates to the system that a statement is a JCL   rather than data Code the Identifi...
Name field Identifies a particular statement so that the other statements and  the system can refer it Syntax     name ...
Operation Field Specifies the type of the statement    Consists of characters in the syntax box for the statement    Fo...
Parameter or Operand Field Also called as Operand field Must end before column 62 Contains parameters separated by comm...
Comment Field Used to enter a comment in the output listing Used to document a job and its resource requirements Can be...
JCL Statements - Basics Code the Operation, Operand and Comments fields in free form  with at least one blank in-between...
JCL Statements – Basics (Contd.) Statements can be continued in  the next line with // in 1 & 2  columns The continued l...
JCL Example              19
JCL Statements - Essential Each Job is identified by a JOB statement that marks the beginning  of a Job    Every job has...
JCL Statements – Essential (Contd.) Each Exec step may contain one or more control statements (DD  statements) to describ...
JCL Statements - Optional IF / THEN / ELSE / ENDIF Statement for selective execution of a Job  Step SET Statement assign...
IF/THEN/ELSE/ENDIF Used to conditionally execute job step with job Examples:  //NAME IF (RC GT 4) THEN                  ...
IF/THEN/ELSE/ENDIF : Example                               24
SET Statement Assign initial values to symbolic parameters Change or Nullify the values of symbolic parameter Syntax:  ...
INCLUDE Statement Identify the member of a partitioned dataset containing the JCL statement Syntax:   //[NAME] INCLUDE M...
NULL STATEMENTIndicates End of Job                          27
Summary   What is JCL ?   Purpose of JCL   Structure of JCL - Examples   Coding Basics of JCL Statements   JCL Statem...
JOB Statement   Session 2                29
Session Coverage   Purpose of JOB Statement   Coding Syntax of JOB statements   Positional and Keyword parameters in a ...
Purpose of JOB Statement   Identifies a job to the OS using a job    name   Indicates which user is responsible    for t...
JOB Statement - Syntax•          Operation Field                   Comment Field//Jobname JOB < parameters>..<comments>   ...
JOB Statement - Name field//TRGR02Y JOB .......             Job name is TRGR02Y              Job name is @TEST//@TEST JOB ...
JOB Statement - Operation field//MYJOB JOB ...                    JOB in Operation Field                    specifies it ...
Parameter Field• //JOBNAME JOB <Parameters>• The following list shows the parameters on Job statement•  ACCT-PARAMETER•  P...
Positional Parameters   Job Statement can contain two positional parameters   First parameter should contain Accounting ...
Positional Parameters - Accounting                Information //JOB1 JOB (XYZ,TRG,3,DB2,123) ...........                 ...
Accounting Information in Real world   Five Fields - all are mandatory      Field1 - Group or Project      Field2 - Sub...
Positional Parameters - Programmer’s                 Name• //JOB1 JOB (XYZ,TRG,3,DB2,123),TRAINING.......                ...
Key Word ParametersThe Job Statement (or Job Card) can contain the following Keywordparameters    CLASS                  ...
Keyword Parameters - CLASS Syntax:       CLASS=<job class> Examples: //JOB1 JOB ACCT1,CLASS=A.. //JOB2 JOB ACCT1,CLAS...
Class Definitions in Real world          Installation   Class A -- 2 sec   Class B -- 7 sec   Class C -- 19 sec   Clas...
Keyword Parameters - TIME   Syntax:                                               Allows this job to use 2 min   TIME=([...
Keyword Parameters – TIME (Contd.)   Syntax:   TIME=([1440]| [NOLIMIT] | [MAXIMUM])   Examples:   //JOB4 JOB ACCT1,CLA...
Keyword Parameters - PRTY   To assign the selection priority to the JOB   Syntax: PRTY=(number)   Examples: //JOB4 JO...
Keyword Parameters - REGION Syntax: REGION={valueK | valueM}   Examples: //JOB1 JOB ACT1,CLASS=A,ADDRSPC=REAL,REGION=2...
Keyword Parameters - ADDRSPC Syntax:  ADDRSPC={REAL | VIRT} Examples:  //JOB1 JOB ACT1,CLASS=A,ADDRSPC=REAL,REGION=20K  ...
Keyword Parameters - MSGCLASS Syntax:  MSGCLASS=<class> Examples:  //JOB1 JOB (XYZ,TRG,3,,123),’TRG GROUP’,  //        C...
Keyword Parameters - MSGLEVEL Details in the listing of Joblog can be controlled, using MSGLEVEL   parameter Syntax:   M...
Keyword Parameters - MSGLEVEL• Statements - Controls the listing of JCL statements in Job log•   0 - The system prints the...
Keyword Parameters - MSGLEVEL• Messages - To control the listing of JCL and JES•             messages in Job log•   0 – Th...
Statements sub-parameter -               MSGLEVEL MSGLEVEL=([statements][,messages])                                     ...
Messages sub-parameter - MSGLEVEL MSGLEVEL=([statements][,messages])            Only JCL messages are                    ...
Keyword Parameters - NOTIFY Syntax: NOTIFY=<user-id>     or NOTIFY=<nodeid.userid> or NOTIFY=<&SYSUID>                ...
Keyword Parameters - TYPRUN Syntax: TYPRUN={HOLD|SCAN}                                                Checks job’s JCL f...
Keyword Parameter - RESTART Syntax: RESTART={* }       Restart job at first job step itself           {stepname}      ...
Keyword parameter - RESTART Example:  //JOB1 JOB ACCT1,MSGCLASS=X,RESTART=COUNT..                                        ...
JOB Statement Examples Example 1 :  //TRGG02X JOB (TRG,GEN,TRGG02,AA,DT99X),’TRG’,  //   CLASS=B,MSGCLASS=X,NOTIFY=TRGG02...
Summary The purpose of the JOB statement Coding Syntax of JOB statement Various options for the Positional and keyword ...
EXEC Statement   Session 3                 60
Session Coverage Purpose of Exec Statement Coding Syntax of Exec statements Positional and Keyword parameters in an Exe...
Purpose of Exec Statement Used to specify which program or procedure an individual job step  has to execute Tells system...
Exec Statement: Example                                                              OS                            Process...
EXEC Statement in JCL•   //JOB1 JOB ....       •   Beginning of JOB•   //ST1 EXEC PGM=P1     •   Beginning of step ST1•   ...
EXEC STATEMENT - Syntax•          Operation Field                      Comment Field//Stepname EXEC < parameters>.. <comme...
Operation field//MYSTEP EXEC ...                       EXEC in Operation Field                       specifies it as Exec...
Parameter Field•   //STEPNAME EXEC <Parameters>•   The following list shows the important parameters on Exec statement•   ...
Positional Parameters   Syntax:       PGM=<program name> OR       PROC=<procedure name> OR       <procedure name>   Exam...
Key Word ParametersThe EXEC statement can contain the following Keywordparameters :    ACCT             •    PARM    AD...
Key word Parameters ACCT – provides accounting information for the job step ADDRSPC – prevents the step from being paged...
Keyword Parameter - PARM   Syntax:    PARM=(<sub parameter,[sub parameter]>)   Examples:                                ...
Program Execution using PARM    JCL for executing program CP1         Cobol Program-CP1•     //JOB1 JOB ACCT1,TRG-GRP,•   ...
Keyword Parameter - COND Syntax: COND=(code,Operator[,step name]) [,EVEN | ONLY] Examples:  //STP1 EXEC PGM=P1,COND=(0,...
Keyword Parameter- COND   Examples:    //STP1 EXEC PGM=P1,COND=EVEN                                       STP1 is execute...
Relational Operators for COND              Rt r c d ( C f o jutc ml t dse               eun o eR ) r m s o pee t pc n pr m...
COND Parameter with Return Codes• Job requiring special  Conditional execution                                            ...
COND Parameter with Return Codes             (Contd.) JCL for executing JOB described in the previous slide  //JOB1 JOB A...
EXEC Statement Examples•   //TRGR02XX JOB (TRG,GEN,TRGR02,AA,DT99X),•   // ‘TRG’,CLASS=B,NOTIFY=TRGR02,MSGCLASS=X•   //ALL...
DD statement in EXEC cont....•              DD statement in EXEC statement is optional. DD statement is usedfor specifying...
Summary The purpose of the Exec statement Coding Syntax of Exec statement Various options for the Positional and keywor...
DD Statement Session 4               81
Session Coverage Purpose of DD Statement Coding Syntax of DD statements    Temporary data sets    DASD data sets    I...
Purpose of DD Statement•                                             OS                  I/P & O/P data sets              ...
DD Statement in JCL•   //JOB1 JOB ACT1,NOTIFY=TRGXXX•   //STEP1 EXEC PGM=P1•   //DD1 DD ...•   //DD2 DD ...               ...
DD Statement - Syntax•       Operation Field                       Comment Field//ddname DD              < parameters>.. <...
Keyword Parameters for DASD               datasets• //ddname DD DSNAME=dataset name•         ,DISP=file’s status•     [   ...
DSNAME Parameter DSN Parameter specifies the Physical file name to be associated  with the DD Name referred by processing...
DSNAME Parameter Syntax:  DSN=<data set name> | <DSNAME(member)>| NULLFILE Dataset name can be :    Qualified data set ...
DSNAME Parameter : Examples Qualified data set name  //INFILE DD DSN=TRGXX.SRC.COBOL, ..... Unqualified name as data set...
Temporary Dataset Syntax:  DSN=&&<data set name> Dataset exists only during the execution of job. Usually called as Work...
Temporary Dataset : Example                              91
DD Statements in relation with                 programsCobol Program-CP1                   JCL for executing program CP1• ...
DISPOSITION Parameter - DISP Syntax:  DISP=<([current status][,normal termination DISP]          [,abnormal termination D...
DISP-Current Status : Examples Sharing the already existing data set.  //INFILE DD DSN=TRGXX.SRC(MEM1),DISP=SHR Exclusiv...
DISP-Normal Termination : Examples Request to keep the data set on normal completion of step.  //INFILE DD DSN=TRGXX.SRC,...
DISP-Abnormal Termination : Examples To Keep the data set on abnormal completion of step.  //FILE1 DD DSN=TRGX.SRC,DISP=(...
DISP Parameter - Defaults• DISP coded on DD statement                System Interpretation•                               ...
Parameters to Define Location of                 Datasets UNIT     Specifies the physical device where an existing datas...
UNIT Parameter Syntax:  UNIT=({[device-number][device-type] [group-name]}            {[,unit-count] [,P]} [,DEFER] )  or ...
UNIT Parameter• //DD1 DD DSN=TRG1.U1,DISP=MOD,• // UNIT=(3390,2)     2 devices are requested• //DD2 DD DSN=TRG1.U,DISP=SHR...
VOLUME Parameter Syntax:  VOLUME= ([PRIVATE] [,RETAIN]  [,vol-seq-number] [,vol-count]  [,{SER=(ser-no[,ser-o]..)} {REF=d...
VOLUME Parameter : Examples• //IN DD DSN=TRG.V1,DISP=(,KEEP),SPACE=(TRK,10).• // VOLUME=(PRIVATE,SER=WORK01)• //OUT1 DD DS...
VOLUME Parameter : Examples• //IN DD DSN=TRG.V1,DISP=(,KEEP),SPACE=(TRK,10),• // VOLUME=(,RETAIN,REF=TRG.V1)• //OUT1 DD DS...
SPACE Parameter Syntax:  SPACE=  ({TRK,}(prqty[,secqty][,dir])[,RLSE][,CONTIG][,ROUND])  {CYL,}  {blklen,}           Numb...
DCB Parameter DCB to define the Characteristics of individual data sets. Syntax:   DCB=(LRECL=nn[,BLKSIZE=yy][,RECFM=zz]...
DCB Parameter : Examples DCB for new PS data set with fixed record length of 80 with  blocking(block contains 10 records)...
DD Statement for Instream data sets Syntax:  //ddname DD (*)       [ ,DLM=xx ]        (DATA) Programs will treat the ins...
Instream data sets : Examples Example 1:  //INDATA DD *  Bh009189lk56  Akp0789mjirm  /* Example 2:  //INDATA DD DATA,DLM...
DD Statement for SYSOUT data sets Syntax:  //ddname DD SYSOUT=x Example:  //SYSPRINT DD SYSOUT=A The SYSOUT parameter  ...
DD Statements for Execution related              Data sets Specifying private program library    JOBLIB    STEPLIB Spe...
Specifying Private Program libraries Private libraries are specified to execute programs that do not   reside in the syst...
JOBLIB : Example•   //MM01E JOB (36512),LE MENENDEZ,NOTIFY=MM01•   //JOBLIB DD DSNAME=MMA.TEST.LOADLIB,DISP=SHR•   //STEP1...
STEPLIB : Example•   //MM01F JOB (36512),LE MENENDEZ,NOTIFY=MM01•   //STEP1 EXEC PGM=IEBGENER•   .•   .•   //STEP2 EXEC PG...
Specifying Dump data set Storage dump is the content of the virtual storage used by the  program before the job terminate...
Summary The purpose of the DD statement Coding Syntax of DD statements for    Temporary data sets    DASD data sets   ...
In-Stream and Cataloged Procedures••             As you gain more experience in submitting jobs, you will    find that you...
In-Stream procedure•                  An in-stream procedure is a named set of job control    statements in a job that can...
Example     ..•   Job Control Statement                         Explanation•    //JOB1 JOB CT1492,JIM MOSER               ...
Cataloged Procedure•              A cataloged procedure, like an in-stream procedure, is a    named set of job control sta...
Example...•   Job Control Statement                                Explanation•   //MYPROC PROC                           ...
Job Processing Overview       Session 5                          123
Job Processing•    Input               Conversion                                              Errors    Phase            ...
JES (Job Entry Subsystem) Internal Readers JES2/JES3   handles the Input Processing JES will select from the   initiator...
Conversion Processing Conversion processing    assigns a job number to the job    analyzes the JCL statements    merge...
Execution Processing JES2 keeps track of each job by  building a Job Queue Element On the Queue, job is selected by    ...
Spooling         Simultaneous Peripheral Operations On Line Spool is a buffer that holds  O/P for printers and process  i...
Output/Print/Purge Processing JES2 processes SYSOUT data sets either when job ends or data set is   closed O/P datasets ...
Input-Conversion-Execution : Summary•                       SpoolJCL         Input            Phase      Input            ...
Program Execution    Session 6                    131
Fundamentals Modular programming:    Aims to split a problem into small, manageable units of work     (modules). Source...
Job Execution                133
Compile-Link-Edit                    134
DD Names for compile-link-go•                        procedures    COBOL Compile Step DD names•   SYSIN -       Source pro...
Linkage-editor Parm Options LIST - lists the linkage-editor control statements MAP - produces a storage map showing the ...
Sample Compilation Job steps• //COMP EXEC PGM=IGYCRCTL,• //  PARM=SOURCE,APOST,MAP,LIST,LIB,NOCMPR2,XREF,FDUMP• //*• //STE...
Sample Link Edit Job steps   Example on multiple load module processing//LKED EXEC PGM=IEWL,// PARM=AMODE=31,RMODE=ANY,TE...
Sample Run Job•   //STEP1 EXEC PGM=TEST••   //STEPLIB DD DSN=TRG1T.COBOL.LOAD,DISP=SHR•   //DTXN DD DSN=TRG1T.COBOL.PGM,DI...
Summary The Compilation-Linkedit and execution procedure DD Statements involved in Compile-Linkedit-Run steps Sample Co...
References z/OS V1R3.0 MVS JCL Reference - Redbook z/OS V1R2.0 MVS JCL Users Guide – Redbook Murach’s Os/390 and z/OS J...
THANK YOU            142
Upcoming SlideShare
Loading in …5
×

Job Control Language

4,082 views

Published on

A complete overview on JCL and its concepts...by rohitkapa

Published in: Technology, Business
8 Comments
18 Likes
Statistics
Notes
No Downloads
Views
Total views
4,082
On SlideShare
0
From Embeds
0
Number of Embeds
13
Actions
Shares
0
Downloads
0
Comments
8
Likes
18
Embeds 0
No embeds

No notes for slide

Job Control Language

  1. 1. JOB CONTROL LANGUAGE Complete Overview
  2. 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. 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. 4. Introduction to JCL Session 1 4
  5. 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. 6. Need for JCL OSAccounting Info Resources Program Region size Job details Priority JCL 6
  7. 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. 8. Job Control Task Job Control Tasks,  Entering Jobs  Processing Jobs  Requesting Resources are performed through,  JCL Statements  JES2 / JES3 Control Statements 8
  9. 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. 10. Job Submission Process USER ACTIONS SYSTEM ACTIONSDetermine 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. 11. JCL Statement SyntaxIdentifier field //NAME OPERATION OPERAND COMMENTS Name Operation Operand / Comment field field Parameter field field 11
  12. 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. 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. 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. 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. 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. 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. 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
  19. 19. JCL Example 19
  20. 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. 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. 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. 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
  24. 24. IF/THEN/ELSE/ENDIF : Example 24
  25. 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. 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
  27. 27. NULL STATEMENTIndicates End of Job 27
  28. 28. Summary What is JCL ? Purpose of JCL Structure of JCL - Examples Coding Basics of JCL Statements JCL Statements – Essential and Optional 28
  29. 29. JOB Statement Session 2 29
  30. 30. Session Coverage Purpose of JOB Statement Coding Syntax of JOB statements Positional and Keyword parameters in a Job Statement Examples 30
  31. 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. 32. JOB Statement - Syntax• Operation Field Comment Field//Jobname JOB < parameters>..<comments> Name Field Operand Field (Job Name) 32
  33. 33. JOB Statement - Name field//TRGR02Y JOB ....... Job name is TRGR02Y Job name is @TEST//@TEST JOB ....... 33
  34. 34. JOB Statement - Operation field//MYJOB JOB ... JOB in Operation Field specifies it as Job statement//JOB1 JOB ... 34
  35. 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. 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. 37. Positional Parameters - Accounting Information //JOB1 JOB (XYZ,TRG,3,DB2,123) ........... Accounting information //JOB2 JOB (XYZ,DHC,1,DTX99,TRGG01) ...... 37
  38. 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. 39. Positional Parameters - Programmer’s Name• //JOB1 JOB (XYZ,TRG,3,DB2,123),TRAINING....... 2nd positional parameter- Accounting parameter programmers name //JOB2 JOB (XYZ,DH,1,DTX99,TRGR01),’XYZ TRG’. //JOB3 JOB ,’Shane o’’Hara’..... Programmers name parameter in quotes No accounting Enclose programmer‘s name within parameter apostrophe if it contains special character 39
  40. 40. Key Word ParametersThe Job Statement (or Job Card) can contain the following Keywordparameters  CLASS  PRTY  TIME  ADDRSPC  REGION  MSGCLASS  MSGLEVEL  NOTIFY  COND  RESTART  TYPRUN 40
  41. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 60. EXEC Statement Session 3 60
  61. 61. Session Coverage Purpose of Exec Statement Coding Syntax of Exec statements Positional and Keyword parameters in an Exec Statement Examples 61
  62. 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. 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. 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. 65. EXEC STATEMENT - Syntax• Operation Field Comment Field//Stepname EXEC < parameters>.. <comments> Name Field Parameters Field 65
  66. 66. Operation field//MYSTEP EXEC ... EXEC in Operation Field specifies it as Exec statement//STEP1 EXEC ... 66
  67. 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. 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. 69. Key Word ParametersThe EXEC statement can contain the following Keywordparameters :  ACCT •  PARM  ADDRSPC  REGION  TIME  COND 69
  70. 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. 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. 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. 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. 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. 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 pc 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 nC N =c d,G) R > c d O D( o e T C =o e R <o e Cc dC N =c d,G) R >o e O D( o e E Cc d R <c d C=o eC N =c d,E ) R ! c d O D( o e Q C =o e R =o e Cc dC N =c d,L ) R < c d O D( o e T C=o e R >o e Cc dC N =c d,L ) R <o e O D( o e E Cc d R >c d C=o eC N =c d,N) R =o e O D( o e E Cc d R! cd C=o e 75
  76. 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 StepEND UPDATE ABENDS 76
  77. 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. 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. 79. DD statement in EXEC cont....• DD statement in EXEC statement is optional. DD statement is usedfor specifying any input to the program or to specify where the output is to beprinted. If there is no input file and if there is no need of output, then we canignore the DD statement in EXEC part.• System generation programs and the programs that are in systemlibrary syslib and proclib can be executed by using EXEC statement without aDD statement.•Eg: //TRGRXX JOB MVS-MVS-U237011-Z9-DT08X,REGION=2096K• //IKJACCNT EXEC IKJACCNT• Once you login the mainframes region, the above job will startexecuting automatically, this needs no DD statement. 79
  80. 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
  81. 81. DD Statement Session 4 81
  82. 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. 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. 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. 85. DD Statement - Syntax• Operation Field Comment Field//ddname DD < parameters>.. <comments> Name Field Key word Parameters Field (DD Name) 85
  86. 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. 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 DSNLOGICAL FILES NAME or PHYSICAL DATA SETDD NAME - Referred by For the DD name referredprocessing program or system by program or system 87
  88. 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. 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. 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. 91. Temporary Dataset : Example 91
  92. 92. DD Statements in relation with programsCobol 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. 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. 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. 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. 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. 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. 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. 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. 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. 101. VOLUME Parameter Syntax: VOLUME= ([PRIVATE] [,RETAIN] [,vol-seq-number] [,vol-count] [,{SER=(ser-no[,ser-o]..)} {REF=dsname}{REF=*.ddname}] ) 101
  102. 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. 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. 104. SPACE Parameter Syntax: SPACE= ({TRK,}(prqty[,secqty][,dir])[,RLSE][,CONTIG][,ROUND]) {CYL,} {blklen,} Number of Units Special Processing RequestsMeasurementUnit 104
  105. 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. 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. 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. 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. 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. 110. DD Statements for Execution related Data sets Specifying private program library  JOBLIB  STEPLIB Specifying dump data set 112
  111. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 121. Job Processing Overview Session 5 123
  122. 122. Job Processing• Input Conversion Errors Phase Phase No Yes Output Execution Phase Phase Error Details Phase Purge End Phase Job 124
  123. 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. 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. 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. 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. 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. 128. Input-Conversion-Execution : Summary• SpoolJCL Input Phase Input Queue Conversion JobProclib Phase Queue Execution Output Queue Phase 130
  129. 129. Program Execution Session 6 131
  130. 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
  131. 131. Job Execution 133
  132. 132. Compile-Link-Edit 134
  133. 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. 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. 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. 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. 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. 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. 139. References z/OS V1R3.0 MVS JCL Reference - Redbook z/OS V1R2.0 MVS JCL Users Guide – Redbook Murach’s Os/390 and z/OS JCL by Raul Menendez and Doug Lowe 141
  140. 140. THANK YOU 142

×