JCL Class Ses

Embed Size (px)

Citation preview

  • 8/8/2019 JCL Class Ses

    1/273

  • 8/8/2019 JCL Class Ses

    2/273

    2

    COURSE OBJECTIVES

    Appreciate the need for Job Control Language.

    Have an overview of Job Control Language in IBM environment.

    Know the structure of Job Control Language statements. Know the usage of the various parameters of Job Control

    Language statements.

    Know the structure of Job Control Language procedures.

    Know the concept of Generation Dataset Groups.

    Know the purpose and usage of common IBM utilities.

    Be able to write JCLs and test them on MVS workbench.

    Appreciate the relation between COBOL program and JCLs.

  • 8/8/2019 JCL Class Ses

    3/273

    3

    SESSION -- I

  • 8/8/2019 JCL Class Ses

    4/273

  • 8/8/2019 JCL Class Ses

    5/273

    5

    JOB CONTROL LANGUAGE ( JCL )

    Job Control Language is a means of communication between a

    program and the MVS Operating System. Without JCL, no program can run on an IBM Mainframe.

    JCL is not a procedural language.

    Provides primary interface between user and JES ( Job EntrySubsystem ).

    Used to perform batch mode processing under MVS.

    Within a job, JCL provides the specification necessary for MVS to process the job.

  • 8/8/2019 JCL Class Ses

    6/273

    6

    Specifications for a job are

    * User identity.

    * Data file identity.* Resource Requirement.

    * Error handling .

  • 8/8/2019 JCL Class Ses

    7/273

    7

    WHY JCL ?

    To identify themselves (users) to the system for security andaccounting purposes.

    To identify the directory and data files required for the job.

    To specify the I/O devices required by the job ( Tape, Disk,Printer).

    To specify what action the system should take in exceptional

    cases.

  • 8/8/2019 JCL Class Ses

    8/273

  • 8/8/2019 JCL Class Ses

    9/273

    9

    HOW JOB IS EXECUTED

    The Initiator selects a job for execution and invokes the

    interpreter. The interpreters job is to examine the job information

    passed to it by JES and create a series of control blocks in the

    address space. For each job step the initiator invokes Allocation Routinesto allocate resources (units, volumes and data sets) required bythe job step.

    Contd..

  • 8/8/2019 JCL Class Ses

    10/273

    10

    HOW JOB IS EXECUTED ( Contd..)

    The Initiator then creates a user region, loads the user programinto it and transfers control to the user program.

    When the execution of user program is complete, the initiator

    invokes routine to deallocate the resources used by the job step.

  • 8/8/2019 JCL Class Ses

    11/273

    11

    OUTPUT LISTING GENERATED AFTER JOBEXECUTION

    Job log : is a record of JES messages written to the operatorsconsole as well as the operators reply where appropriate .

    JCL listing: lists the JCL steps performed.

    The Message Log : shows system messages concerning theexecution of job steps and the allocation and deallocation of datasets.

    Sysprint : output listing for sysprint data set which specifiessysout =A

  • 8/8/2019 JCL Class Ses

    12/273

    12

    BASIC FORMAT OF JCL STATEMENTS

    identifier [name] [operation] [parameters] [comments]

    Explanation

    Identifier Two slashes starting in column 1. Exceptions: (1) for adelimiter statement,/* starting in column 1;(2) for a

    comment statement,//* starting in column 1.

    Name O ne to eight alphanumeric or national characters,starting with a letter or national character.

    Must begin in column 3 if coded.

    Contd..

  • 8/8/2019 JCL Class Ses

    13/273

    13

    Operation A valid operation code,such as JOB,EXEC,or DD.

    Must be preceded and followed by a space.

    Parameters One or more parameters depending on the operation.

    Individual parameters are separated from one another

    by commas,with no intervening spaces.

    Comments Comments may follow the parameters,preceded by one

    space and not extending beyond column 71.

  • 8/8/2019 JCL Class Ses

    14/273

    14

    E.g.. The statements in the sample JCL can be categorizedinto five different fields.

    // Name Operation Parameters Comments// JOB1 JOB (P155),

    XYZ,CLASS=A,PRTY=6.

    // STEP1 EXEC PGM=PROGRAM1

    // REPORT1 DD SYSOUT=A//

  • 8/8/2019 JCL Class Ses

    15/273

    15

    SESSION -- II

  • 8/8/2019 JCL Class Ses

    16/273

    16

    OBJECTIVES

    To understand

    Job statement

    Positional parameters in JOB statement

    Keyword parameters in JOB statement

    To try and solve classroom exercises.

  • 8/8/2019 JCL Class Ses

    17/273

    17

  • 8/8/2019 JCL Class Ses

    18/273

    18

    JOB STATEMENT

    INTRODUCTION

    In JCL, a job can be considered as a unit of work that has to beexecuted. It contains several JCL statements that instruct theoperating system what to do.

    The job statement identifies the beginning of a job to the

    operating system.

  • 8/8/2019 JCL Class Ses

    19/273

    19

    // NAME OPERATION PARAMETERS COMMENTS// JOBNAME JOB OPERANDS

    COMMENTS

    The format of the statement is as given below.

  • 8/8/2019 JCL Class Ses

    20/273

    20

    FUNCTION CORRESPONDING JCLPARAMETER

    Specification of the job

    JOB

    Specification of jobname

    JOBNAME

    Specification of accountinginformation

    (ACCOUNTING INFORMATION)

    Specification of the programmer name

    NAME

    JCL PARAMETERS ON THE JOB STATEMENT

    Contd..

  • 8/8/2019 JCL Class Ses

    21/273

    21

    FUNCTION CORRESPONDING JCLPARAMETER

    Categorization of job CLASSSpecification of outputclass to job log

    MSGCLASS

    Specification of printing the systemmessages

    MSGLEVEL

    Assignment of priority

    to a job

    PRTY

    Holding a job for later execution

    TYPRUN

    (JCL PARAMETERS ON THE JOB STATEMENT Contd...)

  • 8/8/2019 JCL Class Ses

    22/273

    22

    JOBNAME

    The jobname must start in column 3, immediately followingthe double slashes.

    It must be followed by at least one space.

    Valid names can be 1 to 8 alphanumeric characters in length.

    The #, @, and $ symbols can also be included in the name.

    The first character of the name must be alphabetic or national.It cannot be numeric.

  • 8/8/2019 JCL Class Ses

    23/273

  • 8/8/2019 JCL Class Ses

    24/273

    24

    POSITIONAL PARAMETERS IN JOBSTATEMENT

    Job accounting information parameter.

    Programmer name parameter.

    .

  • 8/8/2019 JCL Class Ses

    25/273

    25

    JOB ACCOUNTING INFORMATIONPARAMETER

    Accounting information in an IBM mainframe environment is

    used to bill or charge back any job that is run on the mainframe.

    The accounting information parameter identifies the accountnumber which will be billed for the CPU time utilized on themainframe.

    SYNTAX

    ( account-number, additional accounting information)

  • 8/8/2019 JCL Class Ses

    26/273

    26

    EXAMPLE 1 :

    //JOB1 JOB (A123,DEPT1)

    JOB1 is the name of the job. JOB is the operation. A123 is theaccount number. DEPT1 is the additional accounting information.Since both the parameters are coded, they are enclosed in the

    parenthesis.

    EXAMPLE 2 :

    //JOB1 JOB A123, DEPT1

  • 8/8/2019 JCL Class Ses

    27/273

    27

    PROGRAMMER-NAME PARAMETER

    Programmer name parameter specifies two things:

    . Programmer name

    . Information related to the job being submitted.SYNTAX

    It should be coded immediately after the accountinginformation parameter

  • 8/8/2019 JCL Class Ses

    28/273

    28

    EXAMPLE :

    //JOB1 JOB (A123), VENU

    The parameters in this statement are:

    The double(//) slashes are required at the start of each JCLstatement, in columns 1 and 2.

    JOB1 is the job name and immediately follows the doubleslashes.JOB is the operation.(A123) is the account number. VENU is the programmer name parameter.

  • 8/8/2019 JCL Class Ses

    29/273

    29

    KEYWORD PARAMETERS Keyword parameters must follow positional parameters.

    They can be coded in any order.

    Some of the keyword parameters are :

    CLASSPRTYMSGCLASS

    MSGLEVELTYPRUNNOTIFY

  • 8/8/2019 JCL Class Ses

    30/273

    30

    CLASS PARAMETER

    The class parameter assigns a Jobclass to a job.

    A Jobclass identifies the nature of the job that is to besubmitted.

    Jobs can be short-running or can take a long time, or mayutilize heavy resources.

    The Jobclass is used to identify these characteristics to theoperating system, there by categorizing the job being submitted.

  • 8/8/2019 JCL Class Ses

    31/273

    31

    SYNTAX

    CLASS= Job classWhere job class is any character between A-Z or number

    between 0-9.

    EXAMPLE :

    //JOB1 JOB ( A123), VENU, CLASS=K

  • 8/8/2019 JCL Class Ses

    32/273

    32

    PRTY PARAMETER

    The PRTY parameter is related to the CLASS parameter. Itassigns priority to jobs which belong to the same class.

    SYNTAX

    PRTY=priority

    Priority can range between 0 to 14, or 0 to 15, depending on what

    job entry subsystem (JES2 or JES3) is being run at the time.

  • 8/8/2019 JCL Class Ses

    33/273

    33

    EXAMPLE :

    //JOB1 JOB (A123), VENU,CLASS=8, PRTY=6//JOB2 JOB (A123), VENU,CLASS=8, PRTY=9

    Job 2 will execute before Job1, because it has a higher prioritynumber (9) than Job1.

  • 8/8/2019 JCL Class Ses

    34/273

    34

    MSGCLASS PARAMETER

    Messages can be categorized into two types.

    First, there are those related to the system and the JCL.

    Second, there are those that are output by the program or procedure being executed.

    The MSGCLASS parameter determines the output device to

    which, system messages and JCL messages are written.

  • 8/8/2019 JCL Class Ses

    35/273

    35

    SYNTAX

    MSGCLASS=output-class-nameWhere output-class-name can be any alphabet (A-Z) or number (0-9).

    The output-class-name is related to a specific output device towhich messages are routed.

    MSGCLASS

  • 8/8/2019 JCL Class Ses

    36/273

    36

    EXAMPLE 1 :

    //JOB1 JOB (A123), VENU, CLASS=K,PRTY=6,MSGCLASS=A.

    JOB1 is the jobname, JOB is the keyword identifying the JOB

    statement,(A123) is the account number, VENU is the author, priority is setto 6,and MSGCLASS is A.

  • 8/8/2019 JCL Class Ses

    37/273

    37

    EXAMPLE 2 ://JOB1 JOB (A123),VENU,CLASS=K,PRTY=6,

    MSGCLASS=1

    The message class is set to 1, which could specify a printer or any other output device.

  • 8/8/2019 JCL Class Ses

    38/273

    38

    MSGLEVEL PARAMETER

    . The MSGLEVEL parameter is used to specify the JCL and theallocation messages which will be recorded on the output devicespecified in the message class.

    As a JCL job is submitted, many kinds of messages aregenerated by the system. These messages can be categorized asfollows :

    First, log messages indicating job name, user name, etc. are

    routed to the output device.

    Contd..

  • 8/8/2019 JCL Class Ses

    39/273

    39

    MSGLEVEL PARAMETER (Contd..)

    Next, JCL statements comprising that job are output. Messages related to the execution of the job are output.

    Finally, the output of the program being executed is output.

  • 8/8/2019 JCL Class Ses

    40/273

    40

    SYNTAXMSGLEVEL = (statements, messages)Or

    MSGLEVEL = statementsor MSGLEVEL = (,messages)

    Where statements may be the number 0,1, or 2, and messages is avalue which can be 0 or 1.

    STATEMENTS:Coding a 0 in statements will result in messages related to the jobstatement only being output.

    Contd.

  • 8/8/2019 JCL Class Ses

    41/273

    41

    SYNTAX (Contd..)

    Coding a 1 will result in all JCL in the job being submitted beingoutput.

    In addition to this, if any cataloged procedures are invoked, thentheir JCL will also be output.

    Coding a 2 will result in only the input JCL statements being printed.

    MESSAGES:In the messages field, 0 or 1 can be coded.Coding a 0 will result in all allocation messages being output if the

    job terminates abnormally.

    Coding a 1 will result in all allocation messages being output,regardless of whether the job terminates normally or abnormally.

    MSGLEVEL

  • 8/8/2019 JCL Class Ses

    42/273

    42

    EXAMPLE 1 :

    //JOB1 JOB (A123),JAI,MSGLEVEL=(1,1)

    MSGLEVEL is set to (1,1). All JCL statements will be printed,including allocation messages.

    EXAMPLE 2 :

    //JOB1 JOB (A123),JAI,MSGLEVEL = 0

    Only the JOB statement will be printed.

  • 8/8/2019 JCL Class Ses

    43/273

    43

    TYPRUN PARAMETER

    . Used to specify whether a job is to be held until it is released,or it is to be scanned for syntax errors.

    SYNTAX

    TYPRUN=HOLDOr TYPRUN=SCAN

    Contd..

  • 8/8/2019 JCL Class Ses

    44/273

    44

    TYPRUN PARAMETER (Contd..)

    Specification of HOLD parameter results in the job being helduntil further notice. Useful when jobs which utilize a lot of resources are to be held until a time when the system is relativelyunused.

    Specification of the SCAN parameter results in the job beingscanned for syntax errors and reports them to the requested output

    media

  • 8/8/2019 JCL Class Ses

    45/273

    45

    EXAMPLE 1 :

    //JOB1 JOB (A123),JAI,TYPRUN=HOLD

    JOB1 will be held until it is released by the operator.

    EXAMPLE 2 :

    //JOB2 JOB (A123),JAI,TYPRUN=SCAN

    The JCL will be checked for syntax errors.

  • 8/8/2019 JCL Class Ses

    46/273

    46

    NOTIFY PARAMETER

    The NOTIFY parameter on the JOB statement automaticallynotifies the specified user when the job is completed.

    Example ://JOB10 JOB NOTIFY=JB007

    User JB007 will be notified when the job finishes.

  • 8/8/2019 JCL Class Ses

    47/273

  • 8/8/2019 JCL Class Ses

    48/273

    48

    CLASSROOM EXERCISE - II

    Write a Job statement wherein job name is JOB1, accounting

    information is A123, class is A, message class is B, message level is

    default, priority is 10 and typrun = scan.

  • 8/8/2019 JCL Class Ses

    49/273

    49

    SESSION -- III

  • 8/8/2019 JCL Class Ses

    50/273

    50

    OBJECTIVESTo understand

    EXEC statement

    Positional parameters and Key word parameters

    The following parameters coded on the EXEC statement

    PGM ACCT PARMADDRSPC DPRTY PERFORMRD

    JOBLIB and STEPLIB statementsTo try and solve the classroom exercises

  • 8/8/2019 JCL Class Ses

    51/273

    51

  • 8/8/2019 JCL Class Ses

    52/273

    52

    EXEC STATEMENT

    INTRODUCTION

    The EXEC statement is the first statement of each job step.

    A Job Step is a unit of work that is submitted to the

    operating system in the form of collection of JCL statements. A unit of work can be the execution of a program or, it can

    be the execution of a procedure that is pre-written and available

    for general use by users of the system.

  • 8/8/2019 JCL Class Ses

    53/273

    53

    SYNTAX

    //stepname EXEC PGM=program-name, keyword parameters

    where stepname is the name assigned to the job step, EXEC is the

    operation, program-name is the name of the program ( this is a positional parameter ) and keyword parameters follow the positional parameter

  • 8/8/2019 JCL Class Ses

    54/273

    54

    STEPNAME

    . The STEPNAME is used to give unique and meaningfulnames to each step.

    SYNTAX

    No special syntax is required for this parameter.

    EXAMPLE 1:

    //STEP01 EXEC PGM=PROGRAM1

    STEP01 is the name of the step. EXEC is coded in the operationfield.PGM is the positional parameter. PROGRAM1 is beingexecuted.

  • 8/8/2019 JCL Class Ses

    55/273

    55

    Conditions In Which Stepname Is Mandatory .

    When it is necessary to reference a previously executed job step.

    When an overriding parameter is used.

    When it is required to use a restart parameter. Restart parameter helps to restart the job from the step that failed and avoidsrestarting the entire job consisting several job steps.

  • 8/8/2019 JCL Class Ses

    56/273

    56

    POSITIONAL PARAMETERS OF THE EXECSTATEMENT

    Positional parameters are characterized by the order in whichthey appear, and they must precede keyword parameter.

    There is only one positional parameter in the EXEC statement,that is :

    PGM parameter.

  • 8/8/2019 JCL Class Ses

    57/273

    57

    PGM PARAMETER

    The PGM parameter identifies the name of the program that is

    to be executed.

    SYNTAX

    //stepname EXEC PGM=program-name

  • 8/8/2019 JCL Class Ses

    58/273

    58

    KEYWORD PARAMETERS OF THE EXECSTATEMENT

    The keyword parameters coded for a job step will apply only tothat step.

    Keyword parameters can be coded in any sequence.

    Keyword parameters used in EXEC statement are :

    ACCT parameter PARM parameter

    ADDRSPC parameter DPRTY parameter

    PERFORM parameter RD parameter

  • 8/8/2019 JCL Class Ses

    59/273

    59

    ACCT PARAMETER

    . The ACCT parameter is used to supply accountinginformation for the job step that it is used in.

    SYNTAX

    ACCT=(account-information,...)Or ACCT=account-informationaccount-information consists of one or more subparameters

    defined by installation.

  • 8/8/2019 JCL Class Ses

    60/273

    60

    EXAMPLE 1:

    //STEP1 EXEC PGM=PROGRAM1, ACCT=(A123,RR)

    STEP1 is the stepname, EXEC is the operation. PROGRAM1 is being executed.

    The accounting information that follows the ACCT parameter is

    specific to this job step only.

    EXAMPLE 2:

    //STEP2 EXEC PGM=PROGRAM2,ACCT=A123

    PARM PARAMETER

  • 8/8/2019 JCL Class Ses

    61/273

    61

    PARM PARAMETER

    The PARM parameter is used to supply information to a programas it executes.

    SYNTAXPARM=value

    Where value is a string from 1 to 100 characters long.

    EXAMPLE 1 :

    //STEP1 EXEC PGM=PROGRAM1,PARM=PRINT

    PROGRAM1 is executed, and the string PRINT is supplied to itduring execution.

  • 8/8/2019 JCL Class Ses

    62/273

    62

    EXAMPLE 2 :

    //STEP2 EXEC PGM=PROGRAM2,PARM=13+10

    A special character (+) is included in the string, and therefore thestring is enclosed in apostrophes. The apostrophes are not passed tothe program as part of the string.

    PARM

  • 8/8/2019 JCL Class Ses

    63/273

    63

    JOBLIB AND STEPLIB STATEMENTS

    It is not enough to know the name of the program that is to be

    executed. It is essential to know where that program resides.

    The EXEC statement identifies the member name only. Its

    location in the system has to be specified by the JOBLIB or STEPLIB statements.

    JOBLIB STATEMENT

  • 8/8/2019 JCL Class Ses

    64/273

    64

    JO S

    The JOBLIB statement immediately follows the JOBstatement. It is a DD (Data Definition ) statement , and it specifies where

    the program that is specified by the EXEC statement resides.EXAMPLE 1 ://JOB1 JOB (A123),JAI

    //JOBLIB DD DSN=M1.TEST.LOADLIB,DISP=SHR //STEP1 EXEC PGM=PROGRAM1

    JOBLIB DD statement is used to specify the location of the program that is to be executed. Program1 is a member of the partitioned dataset M1.TEST.LOADLIB.

  • 8/8/2019 JCL Class Ses

    65/273

    65

    EXAMPLE 2 :

    //JOB1 JOB (1234),JAI//JOBLIB DD DSN=M1.TEST.LOADLIB,

    DISP=SHR //STEP1 EXEC PGM=PROGRAM1

    //STEP2 EXEC PGM=PROGRAM2Both PROGRAM1 and PROGRAM2 exist in the library calledM1.TEST.LOADLIB.

    JOBLIB

  • 8/8/2019 JCL Class Ses

    66/273

    66

    EXAMPLE 3 :

    //JOB2 JOB (A123),VENU//JOBLIB DD DSN=PROGRAM3,// DISP=SHR,// UNIT=3321,// VOL=SER=PACK1

    The UNIT and VOL parameters are used because PROGRAM3is uncataloged.

    JOBLIB

    STEPLIB STATEMENT

  • 8/8/2019 JCL Class Ses

    67/273

    67

    STEPLIB STATEMENT

    The function of the STEPLIB statement is the same as the JOBLIBstatement. This statement is coded after the EXEC statement .

    Is effective only for that jobstep, instead of the entire job.EXAMPLE :

    //JOB1 JOB (1234),VENU

    //STEP1 EXEC PGM=PROGRAM1//STEPLIB DD DSN=PROD.LOADLIB1, DISP=SHR //STEP2 EXEC PGM=PROGRAM2//STEPLIB DD DSN=PROD.LOADLIB2, DISP=SHR

    Program1 is a member in the PROD.LOADLIB1 and program2 is amember in the PROD.LOADLIB2.

  • 8/8/2019 JCL Class Ses

    68/273

    68

    CODING BOTH JOBLIB AND STEPLIBSTATEMENTS

    If both the JOBLIB and STEPLIB statements are coded, then theSTEPLIB specification will override that of the JOBLIB for that jobstep

    The specification of the JOBLIB will continue for any jobstepthat does not have a corresponding STEPLIB statement.

    If the same library is used for all jobsteps, then it is good practiceto code the JOBLIB statement.

    EXAMPLE :

  • 8/8/2019 JCL Class Ses

    69/273

    69

    EXAMPLE :

    //JOB1 JOB (1234),VENU// CLASS=0// MSGCLASS=T//JOBLIB DD DSN=A100.TEST.LOADLIB,// DISP=SHR //STEP1 EXEC PGM=PROGRAM1

    //STEPLIB DD DSN=B100. TEST.LOADLIB,// DISP=SHR //STEP2 EXEC PGM=PROGRAM2//STEP3 EXEC PGM=PROGRAM3

    //STEPLIB DD DSN=C100. TEST..LOADLIB,// DISP=SHR //

  • 8/8/2019 JCL Class Ses

    70/273

    70

    ADDRSPC PARAMETER The purpose of this parameter is to indicate to the system thatthe job should use either virtual or real storage.

    Virtual storage results in program addresses being independentof the addresses that actually exist in the computer.

    Setting the ADDRSPC to VIRT results in that job step being paged.

    If ADDRSPC is set to REAL, then the job step is locked intoreal storage only.

  • 8/8/2019 JCL Class Ses

    71/273

    71

    SYNTAX

    ADDRSPC=REAL

    Or ADDRSPC=VIRT

    VIRT indicates virtual storage, and REAL indicates real storageonly.

    If ADDRSPC is omitted, virtual is the default.

    EXAMPLE 1 :

  • 8/8/2019 JCL Class Ses

    72/273

    72

    EXAMPLE 1 ://JOB1 EXEC PGM=PROGRAM1,// ADDRSPC=VIRT

    Program1 will be paged.

    EXAMPLE 2 ://JOB2 EXEC PGM=PROGRAM2,// ADDRSPC=REAL

    PROGRAM 2 will utilize real storage only, and will not be paged.

  • 8/8/2019 JCL Class Ses

    73/273

    73

    DPRTY PARAMETER Used to assign Dispatching Priority to the job step.

    Dispatching priority is used by the system to determine theorder in which tasks are to be executed.

    Dispatching priority is different from class priority. Class

    assigns a priority to the job, and DPRTY assigns a priority to the job step.

  • 8/8/2019 JCL Class Ses

    74/273

    74

    SYNTAX

    DPRTY=(value1,value2)

    Where value1 ranges from 0 to 15 and specifies the priority of the job step.

    Higher the number, higher the priority.

    Value 2 ranges from 0 to 15.

    DPRTY is computed as follows: DPRTY=(value1)*(16)+ value2

  • 8/8/2019 JCL Class Ses

    75/273

    75

    EXAMPLE :

    //JOB1 JOB (A123),VENU//STEP1 EXEC PGM=PROGRAM1,// DPRTY=(12,9)

    The priority in step1 is determined as :

    ( 12 * 16 ) + 9 = 192 + 9 = 201

    PERFORM PARAMETER

  • 8/8/2019 JCL Class Ses

    76/273

    76

    PERFORM PARAMETER

    The PERFORM parameter is used to specify the PerformanceGroup for the job step.

    A Performance Group determines the rate at which the jobsteps in a job have access to system resources and is helpful inoptimizing system performance.

    SYNTAX

    PERFORM=nwhere n ranges from 1 to 999.

  • 8/8/2019 JCL Class Ses

    77/273

    77

    EXAMPLE :

    //JOB1 JOB (A123), VENU//STEP1 EXEC PGM=PROGRAM1,// PERFORM=10

    STEP1 is assigned the performance group10. The number 10 will be installation defined.

    RD PARAMETER

  • 8/8/2019 JCL Class Ses

    78/273

    78

    RD PARAMETER

    The RD ( Restart Definition) is used to specify automatic restartof a job if it abends.

    It also fully or partially suppresses the CHKPT ( Checkpoint)macro instruction, so that no checkpoints are taken as a programexecutes.

    A Checkpoint is taken by the system to record the status of a program as it executes.

    Checkpoints enable to restart a job from the last successfulcheckpoint rather than from the beginning of the run .

    SYNTAX

  • 8/8/2019 JCL Class Ses

    79/273

    79

    RD=R Or RD=RNCOr RD=NR Or RD=NC

    Where R for restartRNC for restart with No Checkpoint

    NR for No Automatic Restart NC for No Checkpoint.

  • 8/8/2019 JCL Class Ses

    80/273

    80

    EXAMPLE 1 :

    //JOB1 JOB (A123), VENU

    //STEP1 EXEC PGM=PROGRAM1,// RD=R

    The operator can perform automatic step restart if the job abends.The checkpoint macro is not suppressed.

  • 8/8/2019 JCL Class Ses

    81/273

    81

    EXAMPLE 2:

    //JOB2 JOB (B123),VENU//STEP2 EXEC PGM=PROGRAM2,// RD=RNC

    The operator can perform automatic step restart if the job stepfails. Checkpoints are suppressed.

    CLASSROOM EXERCISE

  • 8/8/2019 JCL Class Ses

    82/273

    82

    Write a JCL with job name JOB1 , consisting of 4 steps. Step1 isexecuting program COBOL1, Step2 executes COBOL2, Step3

    executes COBOL3 and Step4 executes COBOL4. COBOL1 resideson TRNG.NTP4.COB1, COBOL2 is in TRNG.NTP4.COB2,COBOL3 and COBOL4 lie in TRNG.NTP4.COB3. The PARM

    parameters associated are

    Step1 ------- PRINT, Step2-------- READ, STEP3---------WRITE

    Step4--------- SAVE

  • 8/8/2019 JCL Class Ses

    83/273

    83

    SESSION -- IV

    OBJECTIVES

  • 8/8/2019 JCL Class Ses

    84/273

    84

    To understand The usage of following additional parameters coded on

    both JOB and EXEC statement.REGIONCOND

    TIME The DD statement Concept of Temporary datasets and Permanent datasets.

    DSN parameter coded on the DD statement.To try and solve classroom exercises.

  • 8/8/2019 JCL Class Ses

    85/273

    85

    REGION PARAMETER

  • 8/8/2019 JCL Class Ses

    86/273

    86

    At the time that a job is run, a default amount of work space isautomatically assigned to it. This default can be overriden viathe REGION parameter.

    SYNTAX

    REGION=value1K Or REGION=value2M

    Where value1 is the storage in multiples of 1024 bytes, andvalue2 is storage in multiples of one million bytes. The K and Mmust follow value1 and value2.

  • 8/8/2019 JCL Class Ses

    87/273

    87

    EXAMPLE 1 :

    //JOB1 JOB (A123), VENU//STEP1 EXEC PGM=PROGRAM1,// REGION=96K

    REGION parameter is coded in the EXEC statement, and is used tospecify that this job step can utilize 96 thousand bytes of storage.

  • 8/8/2019 JCL Class Ses

    88/273

    88

    EXAMPLE 2 :

    //JOB1 JOB (A1230),VENU//STEP1 EXEC PGM=PROGRAM1,

    // REGION=88K

    REGION parameter is in the EXEC statement and is set to 88K.

  • 8/8/2019 JCL Class Ses

    89/273

    89

    EXAMPLE 3:

    //JOB3 JOB (A123),VENU,// REGION=3M//STEP1 EXEC PGM=PROGRAM3

    REGION is coded on the JOB statement. The system will allocate3 million bytes of storage for job3.

    REGION CODED ON THEJOB STATEMENT

  • 8/8/2019 JCL Class Ses

    90/273

    90

    JOB STATEMENT

    Usually the system will provide a default region size in which the job is to execute. However this can be overriden by using theREGION parameter coded on the JOB statement. If enough storagespace is not specified the job will terminate abnormally.

    REGION CODED ON THEEXEC STATEMENT

    The REGION parameter coded on an EXEC statement requestsstorage only for that individual job step.If enough storage is notspecified the job will abend .

    COND CODED IN THE JOB STATEMENT

  • 8/8/2019 JCL Class Ses

    91/273

    91

    COND CODED IN THE JOB STATEMENTA COND parameter coded on the JOB statement applies to all jobsteps within the job, and it overrides COND parameters coded on

    the EXEC statement, if they exist.

    SYNTAX

    COND=(comparison-code,condition)

    Where comparison-code is a number between 0 and 4095, andcondition specifies the type of comparison to be made between the

    comparison-code that has been coded, and the return code of the prior step.

  • 8/8/2019 JCL Class Ses

    92/273

    OPERATORS CODED ON THE COND

  • 8/8/2019 JCL Class Ses

    93/273

    93

    Operator Explanation

    GT Bypass current step if comparision-codeis greater than the return code.

    GE Bypass current step if comparision-codeis greater than or equal to return code.

    LT Bypass current step if comparision-codeis less than return code.

    OPERATORS CODED ON THE CONDPARAMETER

    OPERATORS CODED ON THE COND

  • 8/8/2019 JCL Class Ses

    94/273

    94

    Operator Explanation

    LE Bypass current step if comparison-code

    is less than or equal to return code.EQ Bypass current step if comparison-codeis equal to return code.

    NEBypass current step if comparison-codeis not equal to return code.

    OPERATORS CODED ON THE CONDPARAMETER (Contd...)

  • 8/8/2019 JCL Class Ses

    95/273

    95

    EXAMPLE :

    //JOB1 JOB (A123),VENU,// COND=(4,LT)//STEP1 EXEC PGM=PROGRAM1//STEP2 EXEC PGM=PROGRAM2

    //STEP3 EXEC PGM=PROGRAM3

    If a condition code less than 4 is returned at any stepthen the subsequent steps would not be executed.

    COND CODED IN THE EXEC STATEMENT

  • 8/8/2019 JCL Class Ses

    96/273

    96

    COND CODED IN THE EXEC STATEMENT

    The condition parameter coded on the EXEC statement applies

    only to the Job Step that it is coded in.

    This job step is executed or bypassed, depending on the returncodes returned by one or more prior job steps.

    SYNTAX

    COND=(comparison-code condition)

  • 8/8/2019 JCL Class Ses

    97/273

    97

    Comparison-code ranges between 0 and 4095,conditionspecifies the type of comparison to be made between thecomparison-code that has been coded, and the return code of the

    prior step.Contd....

    COND=(comparison-code,condition)or COND=(comparison-code,condition, stepname...)

    or COND=EVENor COND=ONLY

  • 8/8/2019 JCL Class Ses

    98/273

    98

    Step name specifies the name of the preceding step whosereturn code is to be checked.

    The keyword ONLY is used to specify that the step in which

    it is specified is to be executed only if any of the prior stepsterminate abnormally.

    COND

  • 8/8/2019 JCL Class Ses

    99/273

    99

    EXAMPLE :

    //JOB1 JOB (A123),VENU//STEP1 EXEC PGM=PROGRAM1//STEP2 EXEC PGM=PROGRAM2,// COND=(8,EQ,STEP1)

    The COND parameter is used to specify that step2 should be bypassed if 8 is equal to the return code issued by step1.

    TIME PARAMETER

  • 8/8/2019 JCL Class Ses

    100/273

    100

    This is an optional keyword parameter and is used to specifythe amount of CPU Time that a job or step is permitted to utilize

    before it is terminated.

    CPU Time is the time that a job takes to execute.

    When coded in the JOB statement, it specifies the amount of

    CPU time that the JOB is allowed to use. When coded in the EXEC statement, it specifies the amount of CPU time that the job step is allowed to use.

    If the TIME parameter is not specified, then the installationdefined TIME parameter is used.

    SYNTAX

    TIME ( i )

  • 8/8/2019 JCL Class Ses

    101/273

    101

    TIME=(minutes)or TIME=(minutes,seconds)

    or TIME=(,seconds)

    EXAMPLE ://JOB1 JOB (A123),VENU,//STEP1 EXEC PGM=PROGRAM1,// TIME=5

    5 minutes of CPU time is assigned to STEP1.

    TIME Coded On Both JOB Statement AndEXEC Statement

  • 8/8/2019 JCL Class Ses

    102/273

    102

    EXEC Statement

    If the TIME parameter is coded on both the JOB and EXECstatements, then the TIME parameter on the EXEC statement willoverride the TIME parameter on the JOB statement .

    CLASSROOM EXERCISE

    Write a JCL where job name is JOB1,programs to be executed are

  • 8/8/2019 JCL Class Ses

    103/273

    103

    j ,p gCOBOL1, COBOL2, COBOL3, COBOL4.

    COBOL1 and COBOL2 are in TRNG.NTP4.COB,

    COBOL3 is in TRNG.NTP4.COB3 and COBOL4 is inTRNG.NTP4.COB4.

    Region for COBOL2 is 40K and CPU time is 10 min.

    COBOL4 must be executed only if COBOL3 has terminatednormally.

  • 8/8/2019 JCL Class Ses

    104/273

    DD ( DATA DEFINITION ) STATEMENT

  • 8/8/2019 JCL Class Ses

    105/273

    105

    INTRODUCTION

    The data definition statement is used to identify the source of input and the placement of output information.

    On successful execution of a job, the data can be:

    Deleted. Kept. Cataloged. Passed to subsequent job steps. Uncataloged.

    DD STATEMENT

  • 8/8/2019 JCL Class Ses

    106/273

    106

    // Name Operation Parameters Comments

    // dd name DD Operands

    Comments

    DD NAME

    The ddname identifies the name of the data definition

  • 8/8/2019 JCL Class Ses

    107/273

    107

    The ddname identifies the name of the data definitionstatement.

    As a job executes, the system performs device and spaceallocations for each ddname specified.

    Each ddname should be unique within the jobstep.

    EXAMPLE ://JOB1 JOB A123,VENU//STEP1 EXEC PGM=PROGRAM1

    //NAME1 DD DSN=DATA1 NAME1 is the DD name.

    DD NAMES RESERVED FOR THE SYSTEM

    USE

  • 8/8/2019 JCL Class Ses

    108/273

    108

    The following names are reserved for the system use and maynot be used to define DD statements:

    //JOBLIB //JOBCAT

    //SYSABEND //SYSIN

    //SYSCHK //STEPLIB

    //STEPCAT //SYSUDUMP

    //SYSOUT //SYSOUD

    //SYSDBOUT

    DSN PARAMETER

  • 8/8/2019 JCL Class Ses

    109/273

    109

    The DSN parameter is a keyword parameter on the DDstatement. It is used to specify the name of the data set to theoperating system.

    SYNTAX

    DSN=data-set-nameWhere data-set-name can be qualified or non-qualified.

  • 8/8/2019 JCL Class Ses

    110/273

  • 8/8/2019 JCL Class Ses

    111/273

    111

    EXAMPLE:

    //JOB1 JOB A123,VENU//STEP1 EXEC PGM=PROGRAM1// DD DSN=PROJECT1.GROUP2.DATA(TEST1)

    TEMPORARY DATA SETS

  • 8/8/2019 JCL Class Ses

    112/273

    112

    A temporary data set is created during a job execution and

    deleted after job completion. A temporary data set is recognized as such if the DSN parameter is omitted.

    The system assigns a unique name to it, and reference is made toit by referencing the stepname and ddname. This is called a refer

    back.

    EXAMPLE 1:

    //JOB1 JOB A123,VENU

  • 8/8/2019 JCL Class Ses

    113/273

    113

    //JOB1 JOB A123, VENU//STEP1 EXEC PGM=PROGRAM1//DATA1 DD//STEP2 EXEC PGM=PROGRAM2//DATA2 DD *.STEP1.DATA1

    Step1 executes PROGRAM1 and a data set DATA1 is createdin the next statement.

    Step2 executes PROGRAM2 and the temporary data set

    DATA1, created in STEP1 is referenced via referback. * indicatesa referback.

    A temporary data set is also recognized by starting the datasetname with two ampersands in the DSN parameter .

  • 8/8/2019 JCL Class Ses

    114/273

    114

    p p

    EXAMPLE 2 :

    //JOB1 JOB A123,VENU//STEP1 EXEC PGM=PROGRAM1//DATA1 DD DSN=&&ABCD

    Here ABCD is prefixed with two ampersands and is a temporary

    dataset.

    PERMANENT DATA SETS

    A permanent data set is not deleted after a job is completed and

  • 8/8/2019 JCL Class Ses

    115/273

    115

    A permanent data set is not deleted after a job is completed andmay be cataloged, if requested.

    It is coded by setting a DSN parameter that is equal to aqualified or non-qualified name.

    EXAMPLE :

    //JOB1 JOB A123,VENU//STEP1 EXEC PGM=PROGRAM1

    //DATA1 DD DSN=MIS.PROJECT.COBOL(FILE1)

    CLASSROOM EXERCISE

    Write a JCL where job name is JOB1 Two programs COBOL1 and

  • 8/8/2019 JCL Class Ses

    116/273

    116

    Write a JCL where job name is JOB1, Two programs COBOL1 and

    COBOL2 are executed and they are in TRNG.NTP4.COB. A

    temporary dataset NTP is created by step1 and is used by step2. Use

    refer back technique.

  • 8/8/2019 JCL Class Ses

    117/273

    117

    SESSION -- V

    OBJECTIVES

    To understand

  • 8/8/2019 JCL Class Ses

    118/273

    118

    The following parameters and their sub-parameters coded on

    the DD statement.

    DISP

    UNIT

    To interpret the examples using the above parameters and their sub-parameters.

    To try and solve the classroom exercises.

    DISP PARAMETER

    DISP is a keyword parameter, used to instruct the system as toth t t t f d t t d th t t b t k ith th

  • 8/8/2019 JCL Class Ses

    119/273

    119

    the current status of a data set, and the steps to be taken with thedata set upon normal and abnormal termination of the job.

    SYNTAX

    DISP=(status,normal-disposition,abnormal-disposition)

    The status field indicates the current status of the data set i.ewhether it exists or has to be created.

    Contd...

  • 8/8/2019 JCL Class Ses

    120/273

    SUB-PARAMETERS ON DISPPARAMETER

  • 8/8/2019 JCL Class Ses

    121/273

    121

    Status Normal disposition Abnormal disposition NEW DELETE DELETEOLD KEEP KEEP

    MOD CATLG UNCATLGSHR UNCATLG CATLG

    PASS

    NEW SUB-PARAMETER

  • 8/8/2019 JCL Class Ses

    122/273

    122

    Coding DISP= NEW indicates that a new data set is to becreated.

    If the data set is to reside on a direct access volume, such asdisk then the UNIT and SPACE parameters must also be coded.

    NEW is also the default, if nothing is coded in the statusfield.

    EXAMPLE :

  • 8/8/2019 JCL Class Ses

    123/273

    123

    //JOB1 JOB A123,VENU

    //STEP1 EXEC PGM=PROGRAM1//DATA DD DSN=PROJECT1.GROUP1.JCL.(TESTDATA),// DISP=NEW

    Program1 is executed and the data set is created. The nextstatement utilizes the DISP parameter to inform the operatingsystem that this is a new data set

    OLD SUB-PARAMETER

    Coding OLD in the status field results in the operating systemsearching for an existing data set with the name specified in the

  • 8/8/2019 JCL Class Ses

    124/273

    124

    searching for an existing data set with the name specified in theDSN parameter.

    The data set becomes available exclusively to the step in whichit is referenced.

    EXAMPLE ://JOB1 JOB A123,VENU//STEP1 EXEC PGM=PROGRAM1//DATA DD DSN= PROJECT1.GROUP1.JCL(TESTDATA),// DISP=OLD

    MOD SUB-PARAMETER The MOD subparameter is used to modify sequential data

  • 8/8/2019 JCL Class Ses

    125/273

    125

    The MOD subparameter is used to modify sequential datasets.

    The MOD parameter does the following things :

    If the sequential data set does not exist, then the system

    replaces MOD with NEW, and creates it.

    If the data set already exists, use of the MOD subparameter results in the reader/writer of the device positioning itself just

    after the last record, so that records can be added to it easily.

    SHR SUB-PARAMETER

    Setting DISP=SHR allows multiple jobs to read the same data sethi h l d i

  • 8/8/2019 JCL Class Ses

    126/273

    126

    which already exists.

    EXAMPLE :

    //JOB1 JOB A123,VENU//STEP1 EXEC PGM=PROGRAM1//INPUT1 DD DSN=USER1.GROUP1.JCL.NAMEFILE// DISP=SHR

    CLASSROOM EXERCISE

    h b d

  • 8/8/2019 JCL Class Ses

    127/273

    127

    Write a JCL where job name is JOB1 and two programs COBOL1

    and COBOL2 are being executed. Both the programs reside in

    TRNG.NTP4. COBOL1 creates a new permanent dataset which

    will reside in TRNG.NTP4.DATA1 and it is referred by COBOL2.

    NORMAL-DISPOSITION FIELD

    The normal disposition field in the DISP parameter is used toindicate what to do with the data set upon normal termination of the

  • 8/8/2019 JCL Class Ses

    128/273

    128

    p job.

    SYNTAX

    DISP=(status, normal-disposition ,abnormal-disposition)

    The sub-parameters that can be coded here are :

    DELETEKEEPCATLGUNCATLGPASS

    DELETE SUB-PARAMETER

    The delete sub-parameter indicates that the data set beingreferred is to be deleted after the successful termination of the job

  • 8/8/2019 JCL Class Ses

    129/273

    129

    referred is to be deleted after the successful termination of the job.

    EXAMPLE :

    //JOB1 JOB A123,VENU//STEP1 EXEC PGM=PROGRAM1//NAME1 DD DSN=TEMPFILE,// DISP=(OLD,DELETE)

    TEMPFILE is a pre-existing data set that is deleted upon thesuccessful termination of the job JOB1.

    KEEP SUB-PARAMETER

    The KEEP subparameter indicates that the data set is to beretained or kept upon successful execution of the job.

  • 8/8/2019 JCL Class Ses

    130/273

    130

    p p j

    This parameter should be used with permanent data sets.

    EXAMPLE :

    //JOB1 JOB A123,VENU

    //STEP1 EXEC PGM=PROGRAM1//NAME1 DD DSN=BOOKS,// DISP=(OLD,KEEP)

    A permanent data set called BOOKS is retrieved and kept after ithas been read.

  • 8/8/2019 JCL Class Ses

    131/273

    UNCATLG SUB-PARAMETER

    The UNCATLG subparameter is used to remove the entry of thedata set from the system catalogs.

  • 8/8/2019 JCL Class Ses

    132/273

    132

    The data set itself is not deleted.

    EXAMPLE :

    //JOB1 JOB A123,VENU

    //STEP1 EXEC PGM=PROGRAM1//NAME1 DD DSN=DISK.OUTPUT,// DISP=(OLD,UNCATLG)

    The pre-existing data set, called DISK.OUTPUT, is removed fromthe system catalogs. If the data set is not found the job terminatesabnormally.

    PASS SUB-PARAMETER

    Setting DISP to PASS specifies that the data set is to be passed toa subsequent job step within the same job.

    Th d ill i b d b if i

  • 8/8/2019 JCL Class Ses

    133/273

    133

    The data set will continue to be passed to subsequent steps, if itis not utilized by any intervening job steps.

    The data set can be used by any subsequent step.

    Both temporary and permanent data sets can be passed to

    subsequent steps. Data from a prior step can be referenced by its name, or by thereferback syntax.

    If this subparameter is used with tape data sets, then the tapesremain mounted between job step.

    EXAMPLE 1 :

    //JOB1 JOB (K123),JAI//STEP1 EXEC PGM=PROGRAM1//DATA1 DD DSN=FILE1,

  • 8/8/2019 JCL Class Ses

    134/273

    134

    DISP=(NEW,PASS)

    //STEP2 EXEC PGM= PROGRAM2//DATA2 DD DSN=FILE1,DISP=(OLD,DELETE)

    PROGRAM1 creates a new dataset called FILE1.

    The DISP parameter is used to pass it on to subsequent stepswithin that job.

    In STEP2, FILE1 which is passed from the prior step isaccessed. Hence the DISP parameter is : DISP=(OLD,DELETE)

    EXAMPLE 2 :

    //JOB1 JOB (K123),JAI//STEP1 EXEC PGM=PROGRAM1//DATA1 DD DSN=FILE1,

  • 8/8/2019 JCL Class Ses

    135/273

    135

    DISP=(NEW,PASS)

    //STEP2 EXEC PGM= PROGRAM2//DATA2 DD DSN=*.STEP1.DATA1,

    DISP=(OLD,DELETE)

    Data passed from STEP1 is accessed in STEP2 via Referback.Referback follows the following syntax :

    DSN=*.stepname.ddname

    Where * is required, stepname is the name of the step, andddname is the DD statement name.

    EXAMPLE 3 :

    //JOB1 JOB (K123),JAI

  • 8/8/2019 JCL Class Ses

    136/273

    136

    //STEP1 EXEC PGM=PROGRAM1

    //DATA1 DD DSN=&&XYZ,// DISP=(NEW,PASS)//STEP2 EXEC PGM= PROGRAM2//DATA2 DD DSN=*.STEP1.DATA1,

    // DISP=(OLD,DELETE)

    The Refer back method is used to access the temporary dataset&&XYZ, which was created in STEP1.

    CLASSROOM EXERCISE

    Write a JCL where job name is JOB1 and two programs P1 and

  • 8/8/2019 JCL Class Ses

    137/273

    137

    Write a JCL where job name is JOB1 and two programs P1 and

    P2 are executed. A PDS is created by P1 and is exclusively used

    and should be retained on normal termination of the job.

    ABNORMAL-DISPOSITION FIELD

    The abnormal disposition field tells the system what to do withthe data set upon abnormal termination of the job. This subparameter is required only if the abnormal disposition

  • 8/8/2019 JCL Class Ses

    138/273

    138

    This subparameter is required only if the abnormal dispositionis different from the normal disposition.

    DISP=(status,normal-disposition, abnormal-disposition )

    The following subparameters can be used in this field :

    DELETEKEEPUNCATLGCATLG

    The description of each of the above parameters remain the sameexcept that now they refer to abnormal termination of the job.

    EXAMPLE 1 :

    //JOB1 JOB A123,JAI//STEP1 EXEC PGM=PROGRAM1

  • 8/8/2019 JCL Class Ses

    139/273

    139

    //DATA1 DD DSN=FILE1,// DISP=(NEW,CATLG,DELETE)

    The dataset called FILE1, is created. If the job terminatessuccessfully, the system is informed that it should be cataloged.If the job terminates unsuccessfully, the system is instructed todelete it.

    EXAMPLE 2 :

    //JOB1 JOB A123,JAI//STEP1 EXEC PGM=PROGRAM2

  • 8/8/2019 JCL Class Ses

    140/273

    140

    //STEP1 EXEC PGM=PROGRAM2//DATA1 DD DSN=FILE1,// DISP=(NEW,CATLG,KEEP)

    A new dataset FILE1 is created and on successful termination of

    the job the system is instructed to catalog it. Upon unsuccessfultermination, the system is instructed to retain the dataset, but notto catalog it.

    EXAMPLE 3 :

    //JOB1 JOB A123,JAI//STEP1 EXEC PGM=PROGRAM3

  • 8/8/2019 JCL Class Ses

    141/273

    141

    //STEP1 EXEC PGM=PROGRAM3

    //DATA1 DD DSN=FILE1,// DISP=(OLD,CATLG,DELETE)

    The system is informed that FILE1 is a old data set. Upon

    successful termination of the job, this dataset is to be cataloged.Upon unsuccessful termination of the job, it is to be deleted.

    CLASSROOM EXERCISE

    Write a JCL where job name is JOB1 and two programs P1 and P2

  • 8/8/2019 JCL Class Ses

    142/273

    142

    are executed . A PDS is created as a result of the execution of

    program P1 and should be cataloged on normal termination of the

    job and should be deleted on abnormal termination of the job. This

    PDS should be referred back by step 2 where in program P2 is

    executed.

    DISP DEFAULTS

    The status field defaults to NEW

  • 8/8/2019 JCL Class Ses

    143/273

    143

    If the status is NEW the default for normal disposition isDELETE and if the status is old the default for normal dispositionis KEEP.

    The abnormal disposition field defaults to the same value as thenormal disposition field.

    UNIT, VOL AND LABEL PARAMETERS

    The DD statement is used to supply the input and output

  • 8/8/2019 JCL Class Ses

    144/273

    144

    information to the operating system.

    The UNIT parameter is coded on the DD statement to specifyan input or output device that is to be accessed.

    The VOL parameter is also coded on the DD statement toidentify specific disk tape volume(s).

    The LABEL parameter is used to specify information specificto tape datasets.

    UNIT PARAMETER

    INTRODUCTION

    In an IBM mainframe environment input and output devices can

  • 8/8/2019 JCL Class Ses

    145/273

    145

    In an IBM mainframe environment, input and output devices can

    be categorized in different ways. The following characteristics can be used to identify them to the operating system:

    All devices have an address assigned to them at the time that

    they are added to the system. Devices can be referenced via thisaddress.

    Device can be distinguished by a number which indicates the

    numeric model.Contd...

    UNIT PARAMETER (Contd...)

  • 8/8/2019 JCL Class Ses

    146/273

    146

    Certain types of devices can be grouped together, and the groupgiven a name. Devices can be referenced via group name.

    If a device is specified in one job step, then a subsequent step

    may request the same device by referencing the ddname of theDD statement in which the unit was originally specified.

  • 8/8/2019 JCL Class Ses

    147/273

    SYNTAX

    The general syntax for the UNIT parameter is :

    d dd

  • 8/8/2019 JCL Class Ses

    148/273

    148

    UNIT=device-address

    UNIT=device-type

    UNIT=device-group-name

    UNIT=AFF=prior-ddname

    UNIT=(device,DEFER)

  • 8/8/2019 JCL Class Ses

    149/273

    SPECIFICATION OF DEVICE TYPE

    A device type is identified by the model number assigned to thatdevice by IBM. In order to code the device type on the UNIT parameter, one

  • 8/8/2019 JCL Class Ses

    150/273

    150

    needs to know the devices that are being used by the installation.EXAMPLE:

    //JOB1 JOB A123,JAI

    //STEP1 EXEC PROGRAM2//DATA1 DD DSN=FILE2,// UNIT=3380.

    A dataset called FILE2, which resides on a 3380 disk unit, isaccessed.

    Unit parameter

    SPECIFICATION OF DEVICE GROUP

    A device group name is a symbolic name which is assigned to a

  • 8/8/2019 JCL Class Ses

    151/273

    151

    g p y g

    group of devices when the system is generated.

    Devices are often grouped together based on their function.For example, SYSDA is traditionally assigned to direct access storagedevices.

    Unit parameter

    EXAMPLE :

    //JOB1 JOB A123,JAI//STEP1 EXEC PROGRAM3

  • 8/8/2019 JCL Class Ses

    152/273

    152

    //DATA1 DD DSN=FILE3,// UNIT=SYSDA

    A data set called FILE3 resides on any of the devices which aregrouped under the symbolic name SYSDA.

    UNIT parameter

    CLASSROOM EXERCISE

    Write a JCL where job name is JOB1 which executes a program

    P1 and creates a dataset called ABC on unit 3380

  • 8/8/2019 JCL Class Ses

    153/273

    153

    P1 and creates a dataset called ABC on unit 3380.

    AFF SUB-PARAMETER

    The AFF subparameter can be used to reference a device,specified in a prior DD statement. AFF stands for affinity. This kind of specification results in unit affinity, that is same

  • 8/8/2019 JCL Class Ses

    154/273

    154

    unit is reused.SYNTAX

    //ddname1 DD UNIT=TAPE

    //ddname2 DD UNIT=AFF=ddname1ddname1 is the name of the DD statement in which the device for the UNIT parameter was originally specified .

    ddname2 is the name of the DD statement in which the AFF parameter is used to reference the prior DD statement.

  • 8/8/2019 JCL Class Ses

    155/273

    DEFER SUB-PARAMETER

    The DEFER subparameter is coded on the UNIT parameter soh i d f i f h l h i f il

  • 8/8/2019 JCL Class Ses

    156/273

    156

    that it may defer mounting of the volume that it references, untilthe data set that resides on it is opened.

    It prevents volumes from being mounted until they are actually

    needed, thereby freeing up resources for other jobs. If the defer parameter is encountered for a volume that isalready mounted , then it is simply ignored.

    UNIT parameter

    SYNTAX

    //ddname DD UNIT=(device,,DEFER)

  • 8/8/2019 JCL Class Ses

    157/273

    157

    The extra comma in the middle is used to specify the device countsubparameter.

    The device count subparameter identifies the number of tapesrequired for the job.

    EXAMPLE :

    //JOB1 JOB C123,VENU//STEP1 EXEC PGM=PROGRAM1//NAME1 DD DSN=DATA1,

  • 8/8/2019 JCL Class Ses

    158/273

    158

    //NAME1 DD DSN DATA1,// UNIT=(TAPE,,DEFER)

    DEFER parameter is used to specify that DATA1 resides on tape,and that the tape need not be mounted until the system specificallyrequests it.

    This request will be issued by the system at the time that JOB1 is

    executed and PROGRAM1 requires access to DATA1.

  • 8/8/2019 JCL Class Ses

    159/273

    159

    SESSION -- VI

    OBJECTIVES

    To understand The following parameters and their sub-parameters coded onthe DD statement.

  • 8/8/2019 JCL Class Ses

    160/273

    160

    VOLSPACE

    DCB

    To interpret the examples using the above parameters and their sub-parameters.

    To try and solve the classroom exercises.

    VOL PARAMETER

    INTRODUCTION

    The VOL parameter is also coded on the DD statement and is

  • 8/8/2019 JCL Class Ses

    161/273

    161

    pused to identify specific tape(s) or disk volume(s). VOL or VOLUME can be used interchangeably on the DD statement.

    This parameter is used to identify the volume serial number of the device on which a given data set is to be written or on which adataset resides.

    VOL PARAMETER (Contd..)

    Position Within A JCL Statement

  • 8/8/2019 JCL Class Ses

    162/273

    162

    // Name Operation Parameters Comments

    // ddname DD VOL= Comments

    CORRESPONDING JCL PARAMETERSFUNCTION SUBPARAMETERS

    CODED ON THE VOLSTATEMENT .

    Specification of serial SER

  • 8/8/2019 JCL Class Ses

    163/273

    163

    number Referencing VOLspecification

    REF

    Allowing acces to volume by

    all users

    This is the default, unless

    coded otherwise.Inhibiting dismounting of volume by single user

    PRIVATE

    Specification of sequence in

    which volumes are to bemounted.

    SEQ

    TYPES OF LABELS

    VOLUME LABEL

    This contains the volume serial number, and is used for identification purposes by the system.

  • 8/8/2019 JCL Class Ses

    164/273

    164

    p p y y

    DATA SET LABEL

    Data set labels are found at the beginning and at the end of tape data sets. They consist of 80 byte records that contain information for thedata set. Both types of labels reside on the volume itself as data.

    TYPES OF VOLUMES

    Volumes can be classified by the type of access available to theusers . They can be categorized as follows:

  • 8/8/2019 JCL Class Ses

    165/273

    165

    PRIVATE

    These are accessible to a single user only. Tapes are always private.

    PUBLIC

    These are accessible to all users.

    SER SUB-PARAMETER

    The SER subparameter coded on VOL in the DD statement is

  • 8/8/2019 JCL Class Ses

    166/273

    166

    used to request specific volumes.

    SYNTAX

    VOL=SER=serial number.Or VOL=SER=(serial number1, serial number2 )

    Vol parameter

    EXAMPLE :

  • 8/8/2019 JCL Class Ses

    167/273

    167

    //JOB1 JOB A123,VENU//STEP1 EXEC PGM=PROGRAM1//NAME1 DD DSN=DATA1,// VOL=SER=23456

    DATA1 is accessed on a volume whose serial number is 23456

    REF SUB-PARAMETER

    The REF subparameter is a shortcut method used to specify avolume which has been previously defined within the same job.

  • 8/8/2019 JCL Class Ses

    168/273

    168

    SYNTAX

    VOL=REF=referback

    Vol parameter

    EXAMPLE :

    //JOB1 JOB A123,VENU//STEP1 EXEC PGM=PROGRAM1

  • 8/8/2019 JCL Class Ses

    169/273

    169

    //NAME1 DD DSN=DATA1,// VOL=SER=VOL1//NAME2 DD DSN=DATA2,// VOL=REF=*.STEP1.NAME1

    PRIVATE SUB-PARAMETER

    Coding PRIVATE on the VOL parameter results in exclusiveuse of the volume for the data set specified in the job step. Thismeans that only one job can access it at a time.

  • 8/8/2019 JCL Class Ses

    170/273

    170

    SYNTAXVOL=PRIVATE

    EXAMPLE :

    //JOB1 JOB A123,VENU//STEP1 EXEC PGM=PROGRAM1//NAME1 DD DSN=DATA1,

    // VOL=(PRIVATE,,,,SER=23456)Vol parameter

    RETAIN SUB-PARAMETER

    The RETAIN sub parameter is used to indicate that the volumeis not to be dismounted after completion of the job step that it iscoded in.The volume remains mounted until the entire job is

  • 8/8/2019 JCL Class Ses

    171/273

    171

    completed.

    SYNTAX

    VOL=(,RETAIN)

    Or

    VOL=(,RETAIN,...) Vol parameter

    EXAMPLE :

    //JOB1 JOB A123,VENU

  • 8/8/2019 JCL Class Ses

    172/273

    172

    //STEP1 EXEC PGM=PROGRAM1//NAME1 DD DSN=DATA1,// VOL=(,RETAIN,,,SER=TAPE1)

    SEQ (SEQUENCE) SUB-PARAMETER

    The sequence subparameter is used to specify the sequencenumber of the volume that is to be mounted for a particular

    k d l

  • 8/8/2019 JCL Class Ses

    173/273

    173

    step.Like PRIVATE and RETAIN it is a positional parameter.

    SYNTAX

    VOL=(, ,sequence-number)Or

    VOL=(, ,sequence-number,...)

    Vol parameter

    EXAMPLE :

    //JOB1 JOB A123,VENU//STEP1 EXEC PGM=PROGRAM1//NAME1 DD DSN=DATA1,// VOL=SER=HUGE

    //STEP2 EXEC PGM PROGRAM2

  • 8/8/2019 JCL Class Ses

    174/273

    174

    //STEP2 EXEC PGM=PROGRAM2//NAME2 DD DSN=DATA2// VOL=(, ,3,,SER=A123,A124,A125,A126,A127)

    STEP1 executes PROGRAM1 and the dataset called DATA1 isaccessed on the volume whose serial number is HUGE.Since nosequence no. is supplied at position 3, processing starts at volume 1.

    In STEP2 the VOL parameter is used to specify that processing

    should start at volume 3 of a multivolume dataset DATA2.

  • 8/8/2019 JCL Class Ses

    175/273

    SPACE AND DCB PARAMETERS

    The SPACE and DCB parameters are coded on the DDstatement.

  • 8/8/2019 JCL Class Ses

    176/273

    176

    The SPACE parameter is used to allocate storage for newdata sets on direct access storage devices.

    The DCB parameter is used to customize the way data isstored on devices.

    SPACE PARAMETER

    It is an optional keyword parameter on the DD statement.

  • 8/8/2019 JCL Class Ses

    177/273

    177

    // Name Operation Parameters Comments

    // ddname DD SPACE=... Comments

    SYNTAX

    SPACE=(CYL(primary,secondary,directory),RLSE,CONTIG,MXIG,ROUND)

    OR

  • 8/8/2019 JCL Class Ses

    178/273

    178

    OR SPACE=(TRK(primary,secondary,directory),

    RLSE,CONTIG,MXIG,ROUND)OR

    SPACE=(blk(primary,secondary,directory),RLSE,CONTIG,MXIG,ROUND)

  • 8/8/2019 JCL Class Ses

    179/273

    CYL SUB-PARAMETER

    The CYL subparameter is used to allocate space in terms of no of cylinders.

    EXAMPLE :

  • 8/8/2019 JCL Class Ses

    180/273

    180

    EXAMPLE :

    //JOB1 JOB A123,JAI//STEP1 EXEC PGM=PROGRAM1//DATA1 DD DSN=FILE1,// UNIT=3390,// SPACE=(CYL,4)

    SPACE parameter

    REQUESTING SPACE IN BLOCKS

    Space can also be requested in terms of blocks. Blocksize isindependent of the device type.

    EXAMPLE :

  • 8/8/2019 JCL Class Ses

    181/273

    181

    //JOB1 JOB A123,JAI//STEP1 EXEC PGM=PROGRAM1//DATA1 DD DSN=FILE1,

    // UNIT=3390,// SPACE=(2400,1000)

    Here the space allocated is 1000 blocks having block size of

    2400 bytes.

    PRIMARY AND SECONDARY SPACEALLOCATION

    Primary space is the no of bytes that you expect the dataset willrequire for storage.

    Secondary space is the additional space requested if the

  • 8/8/2019 JCL Class Ses

    182/273

    182

    Secondary space is the additional space requested if therequested primary space is insufficient.

    Secondary space, when allocated, does not have to becontiguous with the location of primary allocation.

    Up to 15 extends may be allocated on secondary space.

    EXAMPLE :

    //JOB1 JOB A123,JAI//STEP1 EXEC PGM=PROGRAM1//DATA1 DD DSN=FILE1,// UNIT=3390

  • 8/8/2019 JCL Class Ses

    183/273

    183

    // UNIT 3390,// SPACE=(TRK,(50,25))

    50 tracks are assigned as primary space, and 25 as secondaryspace for FILE1.

    DIRECTORY SUB-PARAMETER

    The DIRECTORY subparameter is used when defining PDS.

    Thi i d d h d l i f

  • 8/8/2019 JCL Class Ses

    184/273

    184

    This storage space is used to record the names and locations of the members created within the PDS.

    This subparameter follows the primary and secondary spacesubparameters.

    SPACE parameter

    EXAMPLE :

    //JOB1 JOB A123,JAI//STEP1 EXEC PGM=PROGRAM1

    //DATA1 DD DSN=FILE1,

  • 8/8/2019 JCL Class Ses

    185/273

    185

    // S ,// UNIT=3390,// SPACE=(TRK,(200,50,10))

    200 tracks are assigned as primary space, and 50 as secondaryspace and 10 tracks are requested for storing name and locationinformation for members that will reside in the PDS

    RLSE SUB-PARAMETER

    The RLSE sub parameter is used to request that space originallyallocated to an output dataset be released when the dataset isclosed.

  • 8/8/2019 JCL Class Ses

    186/273

    186

    A dataset is considered to be closed after the successfulcompletion of a write operation.

    The release parameter helps free up resources for other jobs.

    SPACE parameter

    EXAMPLE :

    //JOB1 JOB A123,JAI//STEP1 EXEC PGM=PROGRAM1

  • 8/8/2019 JCL Class Ses

    187/273

    187

    //DATA1 DD DSN=FILE1,// UNIT=3390,// SPACE=(TRK,(200,50),RLSE)

    CLASSROOM EXERCISE

    Write a JCL where job name is JOB1 , program P1 is executed

    creating a dataset FILE1 on Unit 3380 for which the space is

  • 8/8/2019 JCL Class Ses

    188/273

    188

    g p

    allotted in terms of Tracks with a primary space of 15 tracks and

    secondary space of 30 tracks. Ensure that at the end of the job the

    unused space is released.

    CONTG SUB-PARAMETER

    The CONTG subparameter is used to specify that onlycontiguous space should be allocated to the data set.

    This parameter applies only to primary space allocations.

    EXAMPLE ://JOB1 JOB A123 JAI

  • 8/8/2019 JCL Class Ses

    189/273

    189

    //JOB1 JOB A123,JAI//STEP1 EXEC PGM=PROGRAM1//DATA1 DD DSN=FILE1,// UNIT=3390,// SPACE=(TRK, 200, ,CONTG)

    The extra comma between the primary specification and the

    CONTG parameter is for the RLSE parameter.SPACE param

    MXIG SUB-PARAMETER

    The MXIG subparameter is used to specify that space requestedshould be allocated on the largest contiguous area of spaceavailable on the volume

    EXAMPLE ://JOB1 JOB A123 JAI

  • 8/8/2019 JCL Class Ses

    190/273

    190

    //JOB1 JOB A123,JAI//STEP1 EXEC PGM=PROGRAM1//DATA1 DD DSN=FILE1,// UNIT=3390,// SPACE=(TRK, 700,RLSE,,MXIG)

    700 tracks of primary space is requested on a 3390 disk in an area

    where 700 or more tracks of contiguous space is available.SPACE parameter

    ROUND SUB-PARAMETER

    The use of this subparameter results in space being allocated asthe entire cylinder instead of just portions of it.

    The system computes the amount of storage required, rounds itoff to the nearest cylinder, and allocates that number of cylinders to

  • 8/8/2019 JCL Class Ses

    191/273

    191

    y , ythe request.

    The advantage associated with the use of this parameter is thatdata will reside, starting with the first track of the cylinder, till theend of the last track. Access time is decreased.

    EXAMPLE :

    //JOB1 JOB A123,JAI//STEP1 EXEC PGM=PROGRAM1

    //DATA1 DD DSN=FILE1,// UNIT 3390

  • 8/8/2019 JCL Class Ses

    192/273

    192

    // UNIT=3390,// SPACE=(500,50,,,ROUND)

    50 blocks of 500 bytes are requested as storage space and the roundsubparameter results in space being rounded to the nearest cylinder .

    SPACE parameter

    DCB PARAMETER

    The DCB parameter lets you specify file characteristics that arestored in the files Data Control Block.

    The DCB parameter is coded only for a new data set .

  • 8/8/2019 JCL Class Ses

    193/273

    193

    For existing data sets the information is retrieved from the dataset label.

    In addition, you dont have to code the DCB parameter for anew data set if your application program supplies the requiredinformation .

    The DCB parameter has four sub-parameters

    DSORG, RECFM, LRECL and BLKSIZE.

    They are keyword sub-parameters so you can code them inany order you want.

  • 8/8/2019 JCL Class Ses

    194/273

    194

    SYNTAX :

    DCB=(DSORG=xx,RECFM=format,LRECL=length,BLKSIZE=block size)

    DSORG SUB-PARAMETER

    The DSORG sub-parameter specifies the organization of thedata set.

    DSORG Specifies the data sets organization,as followsPS Physical sequential

  • 8/8/2019 JCL Class Ses

    195/273

    195

    PS Physical sequentialPO PartitionedDA DirectIS Indexed sequential

    EXAMPLE : DCB=(DSORG=PS)

    Specifies a sequential data set.

  • 8/8/2019 JCL Class Ses

    196/273

    EXAMPLE 1 :

    //JOB1 JOB A123,JAI//STEP1 EXEC PGM=PROGRAM1

    //DATA1 DD DSN=FILE1,// UNIT=3390,

  • 8/8/2019 JCL Class Ses

    197/273

    197

    // DCB=(RECFM=F)

    FILE1 is created on a 3390 disk and the parameter F indicates thatthe FILE1 will contain fixed length records.

    LRECL PARAMETER

    The LRECL ( Logical Record Length ) is used to specify the lengthof the record, in bytes, for fixed or variable length records.

    For Fixed Length Record LRECL is equal to the record length.

    For Variable Length Record LRECL is set to the size of thelargest record plus 4 bytes which is used by the system to specify

  • 8/8/2019 JCL Class Ses

    198/273

    198

    largest record plus 4 bytes, which is used by the system to specifythe actual length of the record that follows.

    SYNTAX

    LRECL=number

    Where number is the length in decimal digits.DCB parameter

    EXAMPLE :

    //JOB1 JOB A123,JAI//STEP1 EXEC PGM=PROGRAM1

  • 8/8/2019 JCL Class Ses

    199/273

    199

    //DATA1 DD DSN=FILE1,// UNIT=3390,// DCB=(RECFM=F,LRECL=80)

    DCB parameter

    BLKSIZE PARAMETER

    This parameter is used to specify the blocksize of dataset in bytes. It must be specified as a multiple of the record length for fixedlength records.

    It must be equal to at least the record length plus four bytes for variable length records

  • 8/8/2019 JCL Class Ses

    200/273

    200

    variable length records.

    It must be set to the size of the largest block for undefined lengthrecords.

    SYNTAX

    BLKSIZE=number DCB parameter

    EXAMPLE :

    //JOB1 JOB A123,JAI//STEP1 EXEC PGM=PROGRAM1//DATA1 DD DSN=FILE1,// UNIT=3390

  • 8/8/2019 JCL Class Ses

    201/273

    201

    // UNIT=3390,//

    DCB=(RECFM=FB,LRECL=80,BLKSIZE=1600)

    DCB parameter

    BUFNO PARAMETER

    The BUFNO parameter is used to specify the number of buffersto be allocated to virtual storage for the dataset.SYNTAX

    BUFNO=number

    EXAMPLE 1:

  • 8/8/2019 JCL Class Ses

    202/273

    202

    //JOB1 JOB A123,JAI//STEP1 EXEC PGM=PROGRAM1//DATA1 DD DSN=FILE1,// UNIT=3390,// DCB=(RECFM=FB,LRECL=80,// BLKSIZE=1600,// BUFNO=40) DCB parameter

    CLASSROOM EXERCISE

    Write a JCL where job name is JOB1, program P1 is executed to

    create a dataset FILE1 on unit 3380,volume serial number 234, the

    space allotted as primary is 4 cylinders and secondary is 45

  • 8/8/2019 JCL Class Ses

    203/273

    203

    cylinders , unused space to be released at the end of the job, code

    for contiguous space, the record format is Fixed block, Record

    length is 80 and Block size is 1600.

    SESSION -- VII

  • 8/8/2019 JCL Class Ses

    204/273

    204

    OBJECTIVES

    To understand The function of DUMMY and Concatenated data sets

    The function of special DD statements like SYSOUT, SYSIN

    SYSUDUMP, SYSABEND The use of DLM, DEST, HOLD, OUTLIM parameters coded

  • 8/8/2019 JCL Class Ses

    205/273

    205

    on the DD statement. Importance and usage of Procedures.

    Use of symbolic parameters in Procedures

    The concept of Generation Data Groups

    To try and solve the classroom exercises.

    CODING DATA SETS AND I/O ON THE DDSTATEMENT

    Types of data sets are

    Dummy

    Concatenated

  • 8/8/2019 JCL Class Ses

    206/273

    206

    Special DD statements are :

    SYSOUT SYSIN

    SYSUDUMP

    SYSABEND

    DUMMY PARAMETER

    The Dummy parameter is coded on the DD statement to test theexecution of a program without actually reading or writing to adata set.

    Position In JCL :

    // Name Operation Parameters Comments

  • 8/8/2019 JCL Class Ses

    207/273

    207

    // Name Operation Parameters Comments

    // ddname DD DUMMY Comments

    If DUMMY or NULLFILE is read, then the Operating System

    passes an EOF indicator to the program that is being executed.

    EXAMPLE 1 :

    //JOB1 JOB A123,JAI//STEP1 EXEC PGM=TEST1//DATA1 DD DUMMY

    The program TEST1 is executed and a DUMMY dataset isaccessed.

  • 8/8/2019 JCL Class Ses

    208/273

    208

    EXAMPLE 2 :

    //JOB1 JOB A123,JAI//STEP1 EXEC PGM=TEST2//DATA1 DD DSN=NULLFILE

    CONCATENATING DATASETS

    A dataset can be concatenated and perceived as one file by theoperating system by coding each applicable dataset name one after the other.

    EXAMPLE 1 :

  • 8/8/2019 JCL Class Ses

    209/273

    209

    //JOB1 JOB A123,JAI//STEP1 EXEC PGM=CONCAT1//DATA1 DD DSN=FILE1// DD DSN=FILE2// DD DSN=FILE3.

    FILE1 , FILE2, FILE3 are concatenated.

    SYSUDUMP DD STATEMENT

    Sysudump is coded in the name field of the DD statement.

    Used to obtain a dump of the contents of various registers andvariables in case of abnormal termination of the job.

    EXAMPLE 1 :

  • 8/8/2019 JCL Class Ses

    210/273

    210

    EXAMPLE 1 :

    //JOB1 JOB A123,JAI//STEP1 EXEC PGM=PROGRAM1//SYSUDUMP DD DSN=DUMPFILE,// UNIT=3390,

    // SPACE=(CYL,(1,1),RLSE)

  • 8/8/2019 JCL Class Ses

    211/273

    SYSIN DD STATEMENT

    SYSIN is conventional DD name assigned to input data streams

    which is the data entered when the job is submitted.POSITION IN A JCL :

    // Name Operation Parameters Comments

    // SYSIN DD * or DATA Commentsd f ll

  • 8/8/2019 JCL Class Ses

    212/273

    212

    < data follows >/*

    The * or DATA indicates to the Operating System that inputshould be accepted from the keyboard or coded in the JCL. /* indicates the end of input data stream in the JCL.

    The * or DATA parameter can not be coded in procedures.

    EXAMPLE 1 :

    //JOB1 JOB A123,JAI

    //STEP1 EXEC PGM=PROGRAM1//SYSIN DD */*

    EXAMPLE 2 ://JOB1 JOB A123,JAI

  • 8/8/2019 JCL Class Ses

    213/273

    213

    //STEP1 EXEC PGM=PROGRAM1

    //SYSIN DD DATA/*

    In the second e.g. the use of DATA allows us to use specialcharacters // and /* in the data segment.

    DLM PARAMETER

    The DLM parameter specifies the delimiting character that is to be used to mark the end of the input data stream.

    EXAMPLE :

    //JOB1 JOB A123,JAI//STEP1 EXEC PGM=PROGRAM1//SYSIN DD DATA DLM=@@

  • 8/8/2019 JCL Class Ses

    214/273

    214

    //SYSIN DD DATA,DLM=@@/*@@

    Here the delimiter is@@ and not /* which is also a part of the

    input data stream.

    DEST PARAMETER

    The DEST parameter is used to route output to a specificdestination, which may or may not be a remote location.

    POSITION IN JCL

    // N O i P C

  • 8/8/2019 JCL Class Ses

    215/273

    215

    // Name Operation Parameters Comments

    // ddname DD DEST Comments

    SYNTAX

    The syntax depends on the Job Entry Subsystem being used. In aJES2 environment the syntax is:

    DEST=RMTxxxxOr DEST=RMxxxxOr

  • 8/8/2019 JCL Class Ses

    216/273

    216

    DEST=Rxxxx

    Or DEST=UhhhOr DEST=Nxxxx

    Or Contd.......

    SYNTAX ( Contd..)

    DEST=NnnnRyyOr DEST=LOCAL

    RMT, RM and R stand for Remote Terminal. U specifies a localterminal N specifies a node

  • 8/8/2019 JCL Class Ses

    217/273

    217

    terminal. N specifies a node.

    For the syntax :DEST=NnnnRyyy

    N specifies node, and R specifies a remote workstation connectedto the node.

    EXAMPLE 1 :

    //JOB1 JOB A123,JAI//STEP1 EXEC PGM=XYZ//DATA1 DD DSN=FILE1,// SYSOUT=A,// DEST=RMT1190

  • 8/8/2019 JCL Class Ses

    218/273

    218

    Here the output is directed to output device assigned to class A andits location is designated by the code RMT1190.

    EXAMPLE 2 :

    //JOB1 JOB A123,JAI//STEP1 EXEC PGM=XYZ//DATA1 DD DSN=FILE1,// SYSOUT=A,// DEST=LOCAL

  • 8/8/2019 JCL Class Ses

    219/273

    219

    // DEST=LOCAL

    Output is routed to the local device.

    HOLD PARAMETER

    Hold parameter is used to specify whether the output is to be printed immediately or held until further notice.

    POSITION IN JCL

    // Name Operation Parameters Comments

  • 8/8/2019 JCL Class Ses

    220/273

    220

    // ddname DD HOLD Comments

    SYNTAX

    HOLD=YES/NO

    EXAMPLE :

    //JOB1 JOB A123,JAI//STEP1 EXEC PGM=ABCD//DATA1 DD DSN=FILE1,// SYSOUT=A

  • 8/8/2019 JCL Class Ses

    221/273

    221

    // SYSOUT=A,// HOLD=YES.

    OUTLIM PARAMETER

    The OUTLIM parameter is used to limit the number of linesthat are output to the destination specified in the SYSOUT.

    POSITION IN JCL

  • 8/8/2019 JCL Class Ses

    222/273

    222

    // Name Operation Parameters Comments

    // ddname DD OUTLIM Comments

    EXAMPLE 1 :

    //JOB1 JOB A123,JAI//STEP1 EXEC PGM=OUT1

    //DATA1 DD DSN=FILE1,// SYSOUT=A,// OUTLIM=1000.

  • 8/8/2019 JCL Class Ses

    223/273

    223

    Output routed to the printer is limited to 1000 lines.

  • 8/8/2019 JCL Class Ses

    224/273

    224

    JCL PROCEDURE

    A JCL procedure is a pre-written segment of code that can be included in a job stream.

    The use of procedures helps minimize duplication of code

    and probability of error.

    JCL procedures can be either :

  • 8/8/2019 JCL Class Ses

    225/273

    225

    p

    Cataloged proceduresor

    In-stream procedures

    IN-STREAM PROCEDURES

    Statements of an in-stream procedure appear in the job thatinvokes the procedure and are not members of any PDS.

    An in-stream procedure is available only to the job that containsit.

  • 8/8/2019 JCL Class Ses

    226/273

    226

    Same instream procedure can be invoked more than once from

    within a job.

    In-stream procedures are used mostly for testing procedures thatwill eventually be cataloged.

    EXAMPLE :

    Creating and Executing an Instream Procedure

    //JOB1 JOB A123,JAI//INPROC1 PROC//STEP1 EXEC PGM=OUT1//DATA1 DD DSN=FILE1,// DISP=SHR //STEP2 EXEC PGM=OUT2

  • 8/8/2019 JCL Class Ses

    227/273

    227

    //STEP2 EXEC PGM=OUT2

    //DATA2 DD DSN=FILE2,// DISP=SHR // PEND//STEP77 EXEC PROC= INPROC1

    //

    CATALOGED PROCEDURES

    Statements of a cataloged procedure are written and stored in a partitioned data set.

    A cataloged procedure can be invoked by any job in the system.

    SYS1 PROCLIB is the system procedure library

  • 8/8/2019 JCL Class Ses

    228/273

    228

    SYS1.PROCLIB is the system procedure library.

    It contains mostly system oriented procedures.

    You can also establish alternate procedure libraries,which youcan use instead of SYS1.PROCLIB.

    EXAMPLE 1 :

    //CATPRO PROC//STEP1 EXEC PGM=OUT1//DATA1 DD DSN=FILE1,// DISP=SHR //STEP2 EXEC PGM=OUT2//DATA2 DD DSN=FILE2,// DISP=SHR

  • 8/8/2019 JCL Class Ses

    229/273

    229

    NOTE : A cataloged procedure should never contain a PENDstatement

    Execution Of The Procedure :

    //JOB1 JOB A123,JAI//PROCLIB DD DSN=USER.TEST.PROCLIB,// DISP=SHR //JOBLIB DD DSN=USER.TEST.JOBLIB,// DISP=SHR //STEP10 EXEC CATPRO

  • 8/8/2019 JCL Class Ses

    230/273

    230

    The PROCLIB DD statement defines the location of thecataloged procedure.

    The EXEC executes the cataloged procedure.

    OVERRIDING PARAMETERS INPROCEDURES

    Used to override the parameters of a Procedure for the duration of a job, without actually changing the contents of the original

    procedure.

    SYNTAX

  • 8/8/2019 JCL Class Ses

    231/273

    231

    SYNTAX

    //name Exec procedure-name//procstep.ddname DD modified-parameter

    EXAMPLE

    //PROC1 PROC//STEP1 EXEC PGM=PROGRAM1//DD1 DD DSN=FILE1,DISP= SHR // STEP2 EXEC PGM=PROGRAM2//DD2 DD DSN= FILE2 ,DISP=SHR

    To execute this procedure with a modification in the disposition of FILE1 from SHR to OLD, and the data set name FILE2 to NEWFILE, It is done as:

  • 8/8/2019 JCL Class Ses

    232/273

    232

    //JOB1 JOB A123,VENU//PROCLIB DD DSN=USER.TEST.LIB1// DISP=SHR //EXEC1 EXEC PROC1//STEP1.DD1 DD DSN=FILE1,DISP= OLD// STEP2.DD2 DD DSN= NEWFILE ,DISP=SHR

    SYMBOLIC PARAMETERS

    Symbolic parameters are used to create procedures for generalized use .

    Symbolic parameters provide a convenient means of assigningdifferent values to parameters in commonly used JCL procedures.

  • 8/8/2019 JCL Class Ses

    233/273

    233

    To code a symbolic parameter in a procedure, you code anampersand(&) followed by a name.

    For e.g.DISP=&STAT or SYSOUT=&DEVICE

    SPECIFYING SYMBOLIC PARAMETER VALUES

    To supply values to symbolic parameters, you code them on theEXEC statement that invokes the procedure.For e.g.

    //STEP10 EXEC CATPRO,DEVICE=AHere the &DEVICE symbolic parameter is given a value of A.

    EXAMPLE ://NEWPRO PROC//STEP1 EXEC PGM=CALC

  • 8/8/2019 JCL Class Ses

    234/273

    234

    //DATA1 DD DSN=TRNG.NTP.COB (&FILE1 ),// DISP=SHR To supply a value to the &FILE1 symbolic parameter,you invoke

    the procedure as

    //STEP20 EXEC NEWPRO, FILE1=ASH7

    ASSIGNING DEFAULT VALUES TO SYMBOLICPARAMETERS

    To assign a default value to a symbolic parameter , you define it onthe procedures PROC statement.

    EXAMPLE ://NEWPRO PROC STAT=SHR //STEP1 EXEC PGM=UVW//DATA1 DD DSN=TRNG.NTP.COB(DATFILE),

  • 8/8/2019 JCL Class Ses

    235/273

    235

    ( )

    DISP =&STATIf the programmer doesn't code STAT on the EXEC statement thatinvokes this procedure, the default STAT=SHR will be used .

    EXAMPLE :

    Suppose you have a procedure as follows :

    //NEWPRO PROC FILE1=NEWFILE,STAT=SHR,// DEVICE=CYL,FORMAT=FB

    //STEP10 EXEC PGM=CALC//DATA1 DD DSN=&FILE1,// DISP=&STAT,UNIT=3380,// SPACE (&DEVICE (5 10))

  • 8/8/2019 JCL Class Ses

    236/273

    236

    // SPACE=(&DEVICE,(5,10)),// DCB=(RECFM=&FORMAT)

    Contd...

    If you invoke the previous procedure as

    //STEP1 EXEC NEWPRO

    The parameters on the DATA1 DD statement will take thefollowing default values :

    //DATA1 DD DSN=NEWFILE1,// DISP=SHR,UNIT=3380,// SPACE=(CYL(5 10))

  • 8/8/2019 JCL Class Ses

    237/273

    237

    // SPACE=(CYL(5,10)),// DCB=(RECFM=FB)

    Contd..

    Similarly in the previous procedure,if you want to supply differentvalues to the DSN and DISP parameters and want the other

    parameters to take the default values,then you invoke the procedure as :

    //STEP1 EXEC NEWPRO,FILE1=MYFILE,STAT=OLD

    The parameters on the DATA1 DD statement will take thefollowing values :

  • 8/8/2019 JCL Class Ses

    238/273

    238

    //DATA1 DD DSN=MYFILE,// DISP=OLD,UNIT=3390,// SPACE=(CYL,(5,10)),// DCB=(RECFM=FB)

  • 8/8/2019 JCL Class Ses

    239/273

    239

    THE CONCEPT OF GENERATION DATAGROUPS (GDGs)

    Generation Data Groups are a group of data sets which arerelated to each other chronologically and functionally.

    Data processing applications are cyclical in nature. Theyconsist of new input which is stored inside a file. At a later stagethis existing data is updated with new data , to produce a new file.

  • 8/8/2019 JCL Class Ses

    240/273

    240

    g p p

    The original file is considered as the older generation, and the newone as a new generation.

    Contd...

    THE CONCEPT OF GENERATION DATA

    GROUPS (Contd..)

    Generations can continue until a specified limit is reached.This specifies the total number of generations that can exist atone time. Once this limit is reached, the oldest generation isdeleted.

  • 8/8/2019 JCL Class Ses

    241/273

    241

    SESSION -- VIII

  • 8/8/2019 JCL Class Ses

    242/273

    242

  • 8/8/2019 JCL Class Ses

    243/273

  • 8/8/2019 JCL Class Ses

    244/273

    244

    IBM UTILITIES

    A utility is a useful tool that helps in expediting a task.

    MVS provides a number of prewritten utility programs that

    can be used by the analysts, system programmers andapplication programmers to assist them in organizing data.

    A UTILITY program performs a basic function, i.e., it does a

  • 8/8/2019 JCL Class Ses

    245/273

    245

    routine job which is required repeatedly in an installation.

    CLASSES OF IBM UTILITIES

    SYSTEM UTILITY PROGRAMS

    System Utility Programs can be used to maintain and manipulate

    system and user data sets.

    These programs must reside in an authorized library.

  • 8/8/2019 JCL Class Ses

    246/273

    246

    They can be executed as jobs or be invoked as subroutines of anauthorized program.

    CLASSES OF IBM UTILITIES

    DATA SET UTILITY PROGRAMS:

    Data set utility programs can be used to reorganize, change or compare data at the data set or record level.

  • 8/8/2019 JCL Class Ses

    247/273

    247

    Can be executed as jobs or be invoked as subroutines of a calling program.

  • 8/8/2019 JCL Class Ses

    248/273

    FREQUENTLY REQUIRED FUNCTIONS

    Copy sequential files. Copy partitioned data sets. Catalog data sets. Un catalog data sets. Rename data sets. Compress partitioned data sets. Include members to partitioned data sets when a

  • 8/8/2019 JCL Class Ses

    249/273

    249

    Copy transaction is implemented. Exclude members to partitioned data sets whenA copy transaction is implemented.

    Compare sequential and partitioned data sets.

    Generate generation data groups

    Create /delete data sets allocate / de allocate space on data setsor code other functions on the DD statement, without having toexecute a program.

  • 8/8/2019 JCL Class Ses

    250/273

    250

    JCL REQUIRED TO EXECUTE THE UTILITIES

    The JCL statements, which are required to execute the utility

    program, follow a general pattern.//jobname JOB (accounting-information,)

    programmer-name//stepname EXEC PGM=utility-name, PARM=value//printname DD SYSOUT=print- device-class// inputfile DD input-file-features// outputfile DD output-file-features// workfile DD work-file-features

  • 8/8/2019 JCL Class Ses

    251/273

    251

    // inputdata DD *< --- data statements specific to utility follow --- >

    /*

    //

    SOME IMPORTANT UTILITIES

    IEBGENER

    IEBCOPY

    IEHPROGM

    IEBCOMPR

    IEFBR14

  • 8/8/2019 JCL Class Ses

    252/273

    252

    DFSORT

    MERGE

    IEBGENER

    Most commonly used utility program.

    Used to copy one sequential file to another.

    The original data set and the destination names must bespecified.

    Attributes of both the data sets such as RECFM, LRECL

  • 8/8/2019 JCL Class Ses

    253/273

    253

    must be the same.

    CORRESPONDING JCL

    //jobname JOB accounting-info,programmer-name,// keyword parameters//stepname EXEC PGM=IEBGENER

    //SYSPRINT DD SYSOUT=print- device-class//SYSUT1 DD DSN=source-file-features//SYSUT2 DD DSN=destination-file-features//SYSIN DD DUMMY

  • 8/8/2019 JCL Class Ses

    254/273

    254

    //

    IEBCOPY

    Copy Partitioned Data Sets A PDS can be copied to another PDS, or a sequential data set( on a Tape Drive) , which is known as UNLOADING .

    Used to restore PDS to direct access devices from a TapeDrive, which is known as LOADING .

    Compress Partitioned Data Sets

  • 8/8/2019 JCL Class Ses

    255/273

    255

    Include members of a PDS within a copy transaction.

    Exclude members of a PDS within a copy transaction

    CORRESPONDING JCL

    //jobname JOB accounting-info,programmer-name,// keyword parameters//stepname EXEC PGM=IEBCOPY//SYSPRINT DD SYSOUT=print- device-class

    //SYSUT1 DD DSN=source-file-features//SYSUT2 DD DSN=destination-file-features//SYSIN DD *

    COPY INDD=SYSUT1,

  • 8/8/2019 JCL Class Ses

    256/273

    256

    OUTDD=SYSUT2/*//

    For loading and unloading the following have to be coded ://SYSIN DD *

    COPY INDD=SYSUT1,OUTDD=SYSUT2

    /*//

    For compressing a data set, the SYSUT2 statement is notrequired and the following have to be coded :

  • 8/8/2019 JCL Class Ses

    257/273

    257

    //SYSIN DD *COPY INDD=SYSUT1,OUTDD=SYSUT1

    /*

    //

    To include the members to a PDS the input (SYSUT1) andoutput (SYSUT2) data set names will be the same and thefollowing have to be coded :

    //SYSIN DD *

    COPY INDD=SYSUT1,OUTDD=SYSUT2SELECT MEMBER = ( mem1, mem2,...)

    /*

    //

  • 8/8/2019 JCL Class Ses

    258/273

    258

    //

    IEHPROGM

    Catalog a Data Set.

    Un catalog a Data Set.

    Rename Data Sets. Create an index of a GDG

    D l h i d f i i GDG

  • 8/8/2019 JCL Class Ses

    259/273

    259

    Delete the index of an existing GDG.

    CORRESPONDING JCL

    //jobname JOB accounting-information,programmer-name,// key-word parameters//stepname EXEC PGM=IEHPROGM//SYSPRINT DD SYSOUT=print-device-class

    //SYSUT1 DD UNIT=unitname,// VOL=SER=vol-no// SYSUT2 DD UNIT=unitname,// VOL=SER=vol-no

    //SYSIN DD *

  • 8/8/2019 JCL Class Ses

    260/273

    260

    //SYSIN DD */*//

    CATALOGING A DATA SET

    A data set can be cataloged using the CATLG statement.

    SYNTAX :CATLG DSN=data-set-name

    VOL=device-name=volume-number.

    The above is coded in the SYSIN DD statement.

    //SYSIN DD *CATLG DSN d

  • 8/8/2019 JCL Class Ses

    261/273

    261

    CATLG DSN=data-set-nameVOL=device-name=vol.no

    /*

    //

    UNCATALOGING A DATA SET

    A data set can be uncataloged using the