JCL - MainFrames


JCL   -        Job Control Language
DEFINITION:
          JCL is an interface between application program and operating system
1.     JCL is an 80 byte record structure
2.     By using JCL we can execute or bypass any no of steps ion a job
3.     By using JCL we can use any no of data sets required for job execution
4.     By using JCL we can also define status of the used data sets
The 80 byte record structure is as follo
JCL Statements:
In JCL we have 3 statements. They are…..
1.     Job Statement
2.     EXEC Statement
3.     DD Statement
1. JOB STATEMENT:
a)     Specifies the starting of the job
b)    We can write only one job statement in one JCL
c)     In job statement we have both positional and keyword parameters

       i.            Positional Parameters:
In job statement we have two positional parameters. They are…..
a.     ACCOUNTING INFORMATION
b.     PROGRAMMER NAME
1)    These two are mainly used for the billing purpose to include the bill amount and billers name
2)    These two are also used in job statement for writing job related description
1.     Positional parameters always follow the order
2.     If any one of the above parameter is absent we have to separate with ‘comma’(,)
3.     If two parameters are absent ignore the field
4.     Positional parameters in job statement are optional
     ii.            Keyword Parameters:
The list of keyword parameters existed in a job statement are as follows
1.     CLASS
2.     PRTY
3.     MSG CLASS
4.     MSG LEVEL
5.     TIME
6.     REGION
7.     RESTART
8.     ADDRSPC
9.     TYPRUN
10.                        NOTIFY
1. CLASS:
1.     It is mainly used for categorizing the input jobs
2.     Based on CLASS value we can create or bypass the steps
3.     Possible values are a-z, 0-9
4.     Syntax: CLASS  =       VALUE
CLASS parameter is optional because by default the value is CLASS =         A



2. PRTY:
          When two jobs CLASS names are same based on given priority the is executed
          The priority value ranges from 0-15
          Priority is optional for individual jobs
3. MSGCLASS:
          It is mainly used for routing the output messages of a job
          Possible values are a-z
          MSGCLASS is optional
          Syntax: MSGCLASS   =       VALUE
4. MSGLEVEL:
          It is used to print the level of output description
          Syntax: MSGLEVEL   =       (N,M)
          Where N = JCL messages & M = Allocation messages
          The possible values for N are
a.     0        -        it prints only job card
b.     1        -        it prints user coded JCL and procedure messages
c.      2        -        it prints only the user coded JCL messages
The possible values for M are
a.     0        -        if job terminated abnormally then only it prints messages
b.     1        -        irrespective of job execution it prints the messages
MSGLEVEL is optional because the default value is MSGLEVEL = (1,1)
5. TIME:
          1. Time specifies the maximum amount of time required for job execution
          2. In time we have various values as follows………
                                                             i.      TIME = (M,S)     M = Minutes , S = Seconds
                                                           ii.      TIME = MAXIMUM. It takes the maximum time of a server
I.e.357912 minutes approximately 8.25 months
                                                        iii.      TIME = NO LIMIT or 1440.It takes infinite time for job execution. 1440 is logical value which specifies no limit
6. REGION:
          Specifies maximum amount of memory require for job execution
Syntax: K or        where K = Kilobytes, M = Megabytes
              M
The Maximum memory for REGION is 4M
7. RESTART:
          1. Using RESTART parameter we can bypass any no of steps only from beginning
          2. Using RESTART we cant bypass the steps randomly
                   EX: s1, s2, s3, s4, s5, s6 are the steps
                             RESTART s2
          In the above example execution start from step2 onwards
8. TYPRUN:
1. It specifies the execution status of a job
          2. Using TYPRUN we can also check the JCL code i.e. Syntax check
          3. TYPRUN having different values as follows……
          SYNTAX:
          TYPRUN = SCAN – It checks only syntax errors and wont execute the job
          TYPRUN = COPY – It copies the use code and JCL on to the spool
          TYPRUN = HOLD – It checks only syntax errors and execute the job
          TYPRUN = HOLD – is default


9. ADDRSPC:
a.     It specifies where the job is executing
b.    EX: ADDRSPC = VIRTUAL
       Or
     REAL
10. NOTIFY:
a.     It notifies the execution status of the job to the specific User ID or default login ID
b.    Syntax: NOTIFY = &SYSUID OR
        USER ID
c.      In job statement NOTIFY parameter is mandatory.
2.EXEC STATEMENT:
          EXEC statement specifies starting of a step. Max 255 EXEC statements can be written in one JCL
a.     Positional Parameters:
1.     PGM - Specifies the program name or load module
2.     PROC – Specifies the procedure
Any one of the above parameters is required for the job execution
b.    Keyword Parameters:
1.     TIME
2.     REGION
3.     PARM
4.     COND
1. PARM:
          By using PARM parameter we can pass max 100 characters of data to the program
          PARM is available character which contain both text & length fields
2. COND:
          By using COND parameter we can execute or bypass any no of steps in a job
          In COND parameter it always take previous step return code only i.e. MAXCC
          If the given condition is satisfied it bypass the current step from execution if not the current step is executed
          COND is opposite to the IF statement
          Syntax: COND = (Status Code,Operands,Step Name)
Example:   S1                         MAXXCC = 4
                   S2                         COND = (4,EQ)
                   S3
                   S4
                   S5
Because of given condition step 2 will be bypassed from execution.
In COND we have 2 special values. They are……….
a.     COND = ONLY – If it is coded then the current step is executed if and only if the previous step is abended
b.     COND = EVEN – If it is coded then irrespective of previous step execution it process the current step

3. DD STATEMENT:
          DD statement specifies the data sets using in a JCL
          MAX 3273 DD statements can be written in one JCL
1.     Positional Parameters:
a.     * (ALL) – It is used in control statement and also used in various DD    statements
EX: //SYSIN DD *
b.     Dummy – it is mainly used to bypass the input data
EX: //SYSIN DD DUMMY
c.      Data – It is mainly used to pass the JCL lines
EX: //SYSIN DD DATA
2.     Keyword Parameters:
a.     DSN
b.     DISP
c.      SPACE
d.     DCB
e.      VOL=SER
f.       UNIT
a. DSN (Data Set Name):
          The max length of DSN is 44 characters and for every 8 characters there will be a qualifier and max 5 qualifiers are allowed
          1st qualifier should be USER ID. Possible values are a-z, 0-9, national characters like #, @, $.
b. DISP (Disposition):
          Used to specify status for the data sets
          Syntax: (Status,Normal Disposition,Abnormal Disposition)
c. SPACE:
= (SPACE UNIT,(PRIMARY,SECONDARY,DIRECTORY BLOCK),RLSE)
          Directory Block is required only for PDS. For PS its ‘0’.
          RLSE (RELEASE) – It releases the unused secondary quantity from the resource
d. DCB (Data Control Block) – It specifies attributes of a data set
                   Syntax: DCB = (RECFM = FB,LRECL = VALUE,BLKSIZE = Multiples of LRECL only)
          RECFM     : specifies record format
          LRECL      : Logical Record Length
          BLKSIZE  : Block Size must be multiples of LRECL only
e. VOL = SER (VOLUME SERIAL) – Specifies the name of volume in DASD
                   EX: VOL = SER = DEVMA0
f. UNIT – Specifies the device type
                    EX: UNIT = 3390
3390: Specifies a logical value for device type
SPECIAL DD STATEMENTS:
1.     SYSOUT    – Specifies the output of JCl
2.     SYSPRINT          – Used to Print the program messages
3.     SYSIN        – Used to accept the input data
4.     STEPLIB   – Used to include user defined libraries
5.     JOBLIB     – It is also used to include user defined libraries
6.     JCLLIB     – It is mainly used to call or invoke catalog procedures
UTILITIES
Ø Utilities are IBM supplied programs which are already coded, compiled and  executed to perform a specific functionality
Ø All utilities are pre-defined programs
Ø Utilities are mainly divided into two types. They are…..
1.     Data Set Utilities
2.     System Utilities
Ø The list of utilities available in JCL are as follows……
1.     IEBCOPY                
2.     IEBCOMPR
3.     IEBGENER
4.     IEBEDIT
5.     IEBUPDTE
6.     IEBPTPCH
7.     IEHLIST
8.     IEHPROGM
9.     IEFBR14
10.            IDCAMS
11.            ICEMAN
12.            SORT
Ø All data set utilities always start with prefix IEB

Ø All system utilities always start with prefix IEH

No comments:

Post a Comment