Home
Technology
Mainframe
JCL
Assembler language
VSAM
DB2
CICS
REXX / CLIST language
IMS
HTML Tutorial
JAVA
Aptitude questions - 1
Aptitude questions - 2
News
Stocks
Weather
Quiz
Food Recipes
Videos/Movie Trailers
Jobs
Sports
Playstation
Photo gallery
Earthquake Report
Tamil News
Miscellaneous
Murali Web World Presents
                                      Information Technology  Technical overview 
                                     Mainframe - JCL

  

                                                                                                                                                

JCL
It is an interface between operating system (MVS) & the application program. When two related programs are combined together on control statements, it is called job control language 

Maximum blocksize for a Tape file is 32,760. Based on that we can calculate efficient number of Records in a Block 

Job can be executed continuously on a Mainframe for 248 DAYS 

The maximum number of steps in a Job are 255 

Difference between IEBGENER, IEBCOPY and REPRO in IDCAMS utility
IEBGENER : This utility is used for copying sequential datasets which produces a PDS or a member from a sequential dataset. IEBCOPY : This utility is used for copying one PDS to another or to merge PDSs. REPRO : This is for copying sequential datasets. More or less same as the IEBGENER.



 'S0C7' abend is caused by invalid data in a numeric field

S0C4 error
Storage violation error - can be due to various reasons eg: READING a File that is not open, invalid address referenced due to subscript error 

SD37, SB37, SE37 abends
All indicate Data Set out of space. SD37 - no secondary allocation was specified. SB37 - end of vol and no further volumes specified. SE37 - Max of 16 extents already allocated 

S322 abend
Indicates a time out abend Your program has taken more CPU time than the default limit for the job class Could indicate an infinite loop 

REGION parameter in a JCL step
It is specified to override the REGION defined at the JOB card level REGION specifies the max region size REGION=0K or 0M or omitting REGION means no limit will be applied 

TIME parameter
TIME parameter can be used to overcome S322 abends for programs that genuinely need more CPU time TIME=1440 means no CPU time limit is to be applied to this step 

COND=EVEN
Means execute this step even if any of the previous steps, terminated abnormally 

COND=ONLY
Means execute this step only if any of the previous steps, terminated abnormally 

To check the syntax of a JCL without running, use TYPERUN=SCAN on the JOB card or use JSCAN 

IEBGENER
Used to copy one SAM File to another Source Data Set should be described using SYSUT1 ddname Destination Data Set should be decribed using SYSUT2 IEBGENR can also do some reformatting of data by supplying control cards via SYSIN 

To send output of a COBOL program to a member of a PDS, we need to code the DSN as pds(member) with a DISP of SHR The DISP applies to the pds and not to a specific member

Multiple jobs can be submitted from single JCL (as many jobs as the number of JOB cards) 


//SYSIN DD* input data input data /*  used by ACCEPT statement in COBOL program.

instream data in a PROC cannot be possible.

To run a COBOL batch program from a JCL? 
To run a non DB2 program,

//STEP001 EXEC PGM=MYPROG

 

To run a DB2 program, //STEP001 EXEC PGM=IKJEFT01 //SYSTSIN DD * DSN SYSTEM() RUN PROGRAM(MYPROG) PLAN() LIB() PARMS() /* 

STEPLIB, JOBLIB
Specifies that the private library (or libraries) specified should be searched before the default system libraries in order to locate a program to be executed STEPLIB applies only to the particular step, JOBLIB to all steps in the job . If both are specified in JCL then JOBLIB is ignored.

Order of searching libraries in the jcl is as follows,
First any private libraries as specified in the STEPLIB or JOBLIB, then the system libraries such as SYS1LINKLIB The system libraries are specified in the linklist

If we specify multiple Data Sets in a JOBLIB or STEPLIB then the library with the largest block size should be the first one 37.

 

The default proclib can be changed by specifying JCLLIB ORDER= statement
//ABCD JCLLIB ORDER=(MEMYPROCLIB,SYS1PROCLIB)

When DISP in the JCL is MOD and the program opens the File in OUTPUT mode and when  DISP in the JCL is SHR and the pgm opens the File in EXTEND mode then records will be written to end of File (append) when a WRITE is done in both cases 

DSORG
PS - SAM, PO - Partitioned, IS - ISAM 

Differences between JES2 & JES3
JES3 allocates Data Sets for all the steps before the job is scheduled. In JES2, allocation of Data Sets Required by a step are done only just before the step executes. JOB /EXEC/DD ALL PARAMETERS JOBLIB/STEPLIB PROCEDURES, PARAMETERS PASSING CONDITION VARIABLES ABEND CODES.

Job control statements
The JOB, EXEC and DD statement

42. What is the meaning of keyword in JCL?What is its opposite?
A keyword in a JCL statement may appear in different places and is recognized by its name, eg MSGCLASS in the JOB statement The opposite is positional words, where their meaning is based on their position in the statement, eg in the DISP keyword the =(NEW,CATLG,DELETE) meaning are based on first, second and third position. 

JOB statement
The JOB statement is the first in a JCL stream Its format is // jobname, keyword JOB, accounting information in brackets and keywords, MSGCLASS, MSGLEVEL, NOTIFIY, CLASS, etc . 

EXEC statement
The EXEC statement identifies the program to be executed via a PGM=program name keyword Its format is //jobname EXEC PGM=program name The PARM= keyword can be used to pass external values to the executing program. 

DD statement
The DD statement links the external Data Set name (DSN) to the DDNAME coded within the executing program It links the File names within the program code to the File names know to the MVS operating system The syntax is // ddname DD DSN=Data Set name Other keywords after DSN are DISP, DCB, SPACE, etc . 

PROC
PROC stands for procedure It is 'canned' JCL invoked by a PROC statement An instream PROC is presented within the JCL; a catalogued PROC is referenced from a proclib partitioned Data Set. 

Difference between a symbolic and an override in executing a PROC
A symbolic is a PROC placeholder; the value for the symbolic is supplied when the PROC is invoked, eg &symbol=value An override replaces the PROC's statement with another one; it substitutes for the entire statement 

RESTART
A RESTART is a JOB statement keyword It is used to restart the job at a specified s step rather than at the beginning 

GDG
GDG stands for generation data group It is a Data Set with versions that can be referenced absolutely or relatively It is defined by an IDCAMS define generation datagroup execution 

Concatenating Data Sets means data Sets can be grouped in a DD statement one after another, eg in a JOBLIB statement where the load module can exist in one of many Data Sets. 

Difference between specifying DISP=OLD and DISP=SHR for a Data Set,
A DISP=OLD denotes exclusive control of the Data Set; DISP=SHR means there is no exclusivity .

DISP=MOD is used when the Data Set can be extended, ie, you can add records at the end of an existing Data Set

The keywords associated with the DCB parameter are LRECL, RECFM, BLKSIZE and DSORG The DCB information can be supplied in the DD statement The system looks for DCB information in the program code first

The comment statement is //* followed by the comments.

COND specifies the conditions for executing the subsequent job step The value after the COND= is compared to the return codes of the preceding steps and if the comparison is true, the step is bypassed (If this answer confuses you, welcome to the club - memorize it and don't ask questions!).

MVS now allows for an IF bracketed by an END IF around any job step to replace the COND= syntax Again, if the IF statement is true, the step is bypassed.

The value after the PARM= specifies control information to be passed to the executing program of the job step

 

Space allocation for a Data Set - Primary allocation is the space allocated when the Data Set is first created 
Secondary allocation is done when more space is required than what has already been allocated 

Maximum Extents for a Sequential File is 16 and for  a VSAM File is 123

DISP = (NEW,CATLG,DELETE) means that this is a new Data Set and needs to be allocated, to CATLG the Data Set if the step is successful and to delete the Data Set if the step abends. 

DISP = (NEW,CATLG,KEEP) means this is a new Data Set and needs to be allocated, to CATLG the Data Set if the step is successful and to KEEP but not CATLG the Data Set if the step abends Thus if the step abends, the Data Set would not be catalogued and we would need to supply the Vol ser the next time we refer to it 

To access a File that had a disposition of KEEP, we need to supply volume serial no VOL=SER=xxxx MOD,DELETE 

disp= (,DELETE) means the MOD will cause the Data Set to be created (if it does not exist), and then the two DELETE will cause the Data Set to be deleted whether the step abends or not This disposition is used to clear out a Data Set at the beginning of a job

DD statement for a output File will have the following parameters: DISP=(NEW,CATLG,DELETE), UNIT , SPACE & DCB

if you do not want to keep all the space allocated to a Data Set, we need to specify the parameter RLSE ( release ) in the SPACE. Eg: SPACE=(CYL,(50,50),RLSE)

DISP=(NEW,PASS,DELETE) means this is a new File and create it, if the step terminates normally, pass it to the subsequent steps and if step abends, delete it This Data Set will not exist beyond the JCL 

Ttemporary Data Set can be created either by not specifying any DSNAME or by specifying the temporary File indicator as in DSN=&&TEMP We use them to carry the output of one step to another step in the same job The Data Set will not be retained once the job completes 

To  restart a proc from a particular step - In job card, specify RESTART=proc step step name where procstep = name of the jcl step that invoked the proc and stepname = name of the proc step where you want execution to start 

To skip a particular step in a proc/JOB - we Can use either condition codes or use the jcl control statement IF (only in ESA JCL) 

 if a PROC has five steps Step 3 has a condition code, to nullify this condition code we need to provide the override on the EXEC stmt in the JCL as follows: //STEP001 EXEC procname,CONDstepname=value All parameters on an EXEC stmt in the proc such as COND, PARM have to be overridden like this 

NOTCAT 2 means this is an MVS message indicating that a duplicate catalog entry exists Eg, if you already have a Data Set with dsn = 'xxxxyyyy' and u try to create one with disp new,catlg, you would get this error the program open and write would go through and at the end of the step the system would try to put it in the system catalog at this point since an entry already exists the catlg would fail and give this message you can fix the problem by deleting/uncataloging the first data set and going to the volume where the new Data Set exists(this info is in the msglog of the job) and cataloging it 



REGION specifies the maximum CPU memory allocated for a particular job or job step If REGION is in the JOB card, it relates to the entire job; if in the EXEC statement, it relates to the job step .

Data definition(DD statement) name is the eight character designation after the // of the DD statement It matches the internal name specified in the steps executing program In COBOL that's the name specified after the ASSIGN in the SELECT ASSIGN statement Data Set name is the operating system (MVS) name for the File

For an output File DUMMY specifies that the output is to be discarded For input it specifies that the File is empty. 

The difference between BLKSIZE and LRECL is BLKSIZE specifies the number of bytes 

Difference between the positional parameters & keyword parameters, give examples where they are used?
Positional Parameters are:- a).Sequence predetermined b) Parameters separated by commas c) Omitted parameters must be indicated by two consecutive commas. d) Installation dependent EX: //JOBNAME JOB (DIS, TRG.TRGGLO.NL.BATCH), ‘PGM1) //SETP01 EXEC PGM=MYPROG Keyword parameters are Predetermined words are referred to as key word Parameters. Any sequence is permitted, separated by commas. Follow positional parameters. Format is = EX: //JOBNAME JOB (DIS, TRG, N1, BATCH), MSGLEVEL=(1,1), // MSGCLASS=X, NOTIFY=QZ6P03T, TYPRUN=SCAN 

The Catalog procedure called from a JCL,
STEP1 EXEC PROC=PROC1 The library in which PROC1 is present should be mentioned in PROCLIB.

Symbolic Parameter
Any parameter that can vary with each execution is a good candidate for definition of a symbolic parameter. Use of symbolic parameter make the procedure more flexible. This prevents the procedure to be modified each and every time a small and recurring change is needed at a place. //DD1 DD DSNAME=&SYSUID..PROFILE,DISP=(NEW,KEEP), 


GDG is Generation Data Group. GDG’S allow users to create multiple data sets with the same base name distinguished by a logical number. History files can be referenced by using a negative generation number. GDG base can be created using a utility (IEBPROGM or IDCAMS) With (+1) we will be creating. EX: //OUTDD DD DSN=QZ6P03T.ARUN.MASTER(+1) (Create new data set) //INDD DD DSN=QZ6P03T.ARUN.MASTER(+0) (Reference most current data set). Yes - GDG can be sequential, direct, or partitioned Organization and can be reside on tape or direct-access volumes GDG must always be cataloged

The maximum number of GDG versions that can be created is 255. A GDG data set is created with “(+1)” appended to the name of the GDG base. 

Error codes,
S0C1 (Operation Exception Error) - May be due to

Missing or misspelled DD name

Read/Write to unopened dataset

Reading a dataset opened output mode

Writing into a dataset opened input mode

Called subprogram not found

S0C4 may be due to

Missing Select statement (during compile)

Bad Subscript/index

Protection Exception

Missing parameters on called subprogram

Read/Write to unopened file

Move data from/to unopened file;

S0C5 May be due to

Bad Subscript/index

Close an unopened dataset

Bad exit from a perform

Access to I/O area (FD) before read;

S0C7 may be due to

Numeric operation on non-numeric data

Un-initialized working storage

Coding past the maximum allowed subscript

S0CB might be due to 1.Division by Zero 

CONTROL CARD
CONTROL CARD can be a member of a PDS or a sequential dataset and is used for storing the date fields, definitions of VSAM files etc., We use CONTROL CARD because we cannot use an in-stream procedure in a procedure. Generally you will be calling a PROC from your JCL and you cannot code instream procedure in the PROC and so you will point to the dataset, which is called controlcard. 

INCLUDE statement in JCL
An INCLUDE statement identifies a member of a PDS that contains this set of JCL statements is called an INCLUDE group. The system replaces the INCLUDE statement with the statements in the INCLUDE group. 

Maximum number of In-stream procedures you can code in any JCL are 15.