Showing posts with label jcl tutorials. Show all posts
Showing posts with label jcl tutorials. Show all posts

Monday, December 28, 2009

In JCL (Job Control Language), does a FLUSH return code have any numeric value?

Answer:
No. Flush means the step did not execute. Valid return codes for steps that execute are in the range of 0-4095.

What are the advantages of job control language?

The Following are the Advantages of Job Control Language.
Identifies the job.
Usually provides information to enable the computer services department to bill the appropriate user department.
Defines how the job as a whole is to be run, e.g. its priority relative to other jobs in the queue.

Thursday, May 14, 2009

JCL Tutorial 5 - EXEC statement

EXEC statement

EXEC statement is used to execute a program/procedure

A maximum of 255 EXEC statement can code in an single job

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

            Positional parameter  -  Program-name


Keyword parameters for EXEC
  
            PARM  ACCT ADDRSPC DPRTY PERFORM RD

PARM

          PARAM parameter is used to pass information to program

          Syntax  ->  PARM=value
                 
                      Value is a string can be 1 to 100 characters long.

PARM-INDICATOR will contain "RAMESH"

         PARM-LENGTH contains length of string.             



Remaining parameters , We wont use much     

ACCT    - accounting information for that step

ADDRSPC - used to indicate to the system that the job step is use either 
          virtual or real storage
 
DPRTY   - used to assign priority to the job step

PERFORM - specifies the rate at which system resources used by job step

RD      - restart definition is used to specify automatic restart of a job 
          if it abends

          
         PASSING PARAMETER USING PARM PARAMETER
 
Q. If there is a situation, where we need to code more than 255 steps in a JOB? 
A. We need to split jcl into two jcls , at the end of the first jcl check the condition
code and initiate the second jcl.

Mainframes JCL Using JOBLIB / STEPLIB

JOBLIB / STEPLIB

JOBLIB

      It is a DD (Data definition) statement, and it specifies where 
      the program (which is specified in EXEC statement) exists. 
      It is applicable to all job steps in that job. It cannot be used 
      in cataloged procedures.

      Syntax  ->  //JOBLIB  DD  DSN=dataset

      EXAMPLE JCL ->
                         
                  //MYJOB   JOB   (E343),'STUDENZONE'  
                  //JOBLIB  DD    DSN=SE.TEST.LOADLIB,DISP=SHR    <---  Attention
                  //STEP1   EXEC  PGM=COBPROG

                        
                 Immediately following the JOB statement is the JOBLIB DD 
                 statement. This is used to specify the location of the 
                 program that is to be executed.
STEPLIB

         It is also like JOBLIB. It is used to tell in which dataset 
   program resides, It will be coded in JOB STEP. It is only 
   for that step instead of entire JOB. It can be placed any 
   where in the job step. STEPLIB can be coded in cataloged 
   procedures.

         Syntax  ->      //STEPLIB  DD  DSN=dataset

         Example JCL ->  //MYJOB   JOB   (U456),'STUDENZONE
'
                         //STEP1   EXEC  PGM=COBPROG                                                 
                         //STEPLIB DD    DSN=TEST.MYPROD.LIB,DISP=SHR
                         //STEP2   EXEC  PGM=COBPROG2
                         //STEPLIB DD    DSN=TEST.MYPROD.LIB1,DISP=SHR

                         In above example, STEP1 is executing COBPROG which 
                         is member of TEST.MYPROD.LIB 

                         STEP2 is executing COBPROG2 which is 
                         member of TEST.MYPROD.LIB1
 
If both the JOBLIB and STEPLIB statements are coded, then the STEPLIB specification
                         will override JOBLIB specification.