JCL Interview Questions

JCL (Job Control Language) is a programming language used to define jobs for IBM's S/390 mainframe computers' MVS, OS/390, and VSE operating systems. This blog will be extremely beneficial if you are preparing for an upcoming interview in this field. These JCL interview questions can assist both beginners and professionals ace the job interview.

JCL, or Job Control Language, is a programming language that was developed in 1964. JCL refers to scripting languages used on IBM mainframe operating systems to instruct the machine on how to run a batch job or launch a subsystem. The objective of JCL is to indicate which programmes to run, which files or devices to use for input or output, and, on occasion, when to skip a step.

In this blog, we've compiled a list of the most important JCL Interview Questions and Answers, along with detailed explanations. Let's take a look ahead.

We have classified JCL Interview Questions - 2023 (Updated) into two stages, they are:

Frequently Asked JCL interview questions

JCL Interview Questions - For Freshers

1. What is JCL (Job Control Language)?

Job Control Language (JCL) is a programming language that allows you to control how your computer works. On the IBM mainframe operating system, JCL is a scripting language used to command the system for batch jobs. It's a sequence of statements you write to tell the operating system what you want to do. This set of statements can be fairly vast at times, but most jobs can be completed with only a small portion of it.

Interaction Between JCL, OS and Program

2. What are the benefits of using JCL?

The following are the benefits of JCL:

  • Using JCL, you can remove and construct a large number of data sets, VSAM Clusters, and Generation Data Groups.
  • It can be used to compare files with different PDS (Partitioned Data Set) members.
  • You can use it to merge and sort a number of different data sets.
  • It may also execute and compile batch-based programmes (programmes that are scheduled to run on a computer without further user intervention and are allocated through JCL).
  • Beginners will find JCL simple to learn because it is straightforward to alter.
  • It also includes a variety of utilities, such as IEDCOPY and IDCAMS, that make it easier and more convenient to do jobs.

3. Explain different types of Job control statements or JCL statements.

You must specify where to get the input, how to process it, and what to do with the output for each job you submit. Job control statements in JCL are used to send data to MVS (Multiple Virtual Storage). JCL's comprehensive set of work control statements provides MVS with a wealth of information. Most activities, however, may be conducted using only a small number of these control statements. As you grow more comfortable with the jobs you normally run, you may find that you only need to understand the intricacies of a handful of the control statements.

Types of Job Control Statements

The following three sorts of job control statements can be identified:

JOB Statement: It's the first of three JCL control statements that inform the mainframe OS (Operating System) about the job's identification. Other options in the JOB statement include class, msgclass, and msglevel, in addition to the Job name and accounting data. These options make it easier for the OS to choose the right scheduler. It can also be used to monitor CPU usage and provide messages to the user.

Syntax:

//Job-name JOB Positional-param, Keyword-param

Here,

  • After "//," the job-name defines a name for the job. It can be 1 to 8 alphanumeric characters long.
  • It's a JOB statement because of the phrase 'JOB.'
  • Positional parameters are referred to as positional parameters, and keyword parameters are referred to as keyword parameters.

Example:

//STEP01 EXEC PGM=INTERVIEWBIT

DD Statement: Data Definition (DD) aids in the specification of data sets used by a programme or procedure. A DD statement must be used to specify the required input and output resources for each job phase. Every data set utilised or generated in a job step must have DD statements. A step can include up to 3273 DD statements.

Syntax:

//DD-name DD Parameters

Here,

  • DD-name appears directly after "//" and gives the DD-statement a name.
  • It is identified as a DD statement by the keyword 'DD.'
  • For DD statements, parameters represent many types of parameters.

Example:

//STEP01 EXEC PGM=INTERVIEWBIT

DD Statement: Data Definition (DD) aids in the specification of data sets used by a programme or procedure. A DD statement must be used to specify the required input and output resources for each job phase. Every data set utilised or generated in a job step must have DD statements. A step can include up to 3273 DD statements.

Syntax:

//DD-name DD Parameters  

4. State the difference between a positional parameter and keyword parameter in JCL.

Positional Parameters: In a JCL statement, positional parameters are those that appear in a specific order. They must be specified in that order since their order in the JCL statement is always fixed. An error will occur if the positional parameters in the JCL are moved.

Examples: ACCT (Accounting Information), PGM (Programmer Name), etc.

Keyword Parameters: For these characteristics, there is no need for a fixed position. There are no problems regardless of the sequence in which the keyword arguments are coded.

Examples: TIME, REGION, MSGLEVEL, CLASS, etc.

5. How does JCL act on a COBOL code?

JCL is dealt with through a specific set of divisions.

  • Identification Division: Assist in the learning of JCL. It introduces the name of the application, the author, the date, and other information to JCL, but there is no interaction code.
  • Environment Division: JCL can interface with the operating system thanks to the environment division. Under file operation, the OS sends a request for Files.
  • Data Division: It works with the accessed file in accordance with READ or PRINT actions (with the help of OS).
  • Procedure Division: It contains numerous operations performed on files, such as closing open files.

MindMajix YouTube Channel

6. What is the use of symbol // in JCL?

It's an important indication in JCL statements. This indicator must appear at the beginning of every JCL statement. The JCL statements are executed in accordance with a set of rules; otherwise, the JCL statement will fail.
The JCL execution mechanism checks the symbol (//) at the beginning of JCL statements first. It prevents exceptions from happening in the middle of a program's execution.

7. What are the hierarchy levels in JCL?

The hierarchy levels are present in every JCL statement:

  • Identifier field
  • Name field
  • Operation field
  • Parameter field (POSITIONAL, KEYWORD)
  • Comment field (if any)

Hirarchy Levels in JCL

8. What is condition checking in JCL? Is this possible?

Condition checking is supported by JCL. At both the job and code levels, condition checking is possible. It's done with the COND keyword and a preset return code and operand in JCL. As a result, it is possible in JCL.

9. Explain the JOB statement in JCL?

The Task statement tells the Operating System (OS) in the spool and the scheduler the job identity. In a JCL, it is the first control statement. The JOB statement's available parameters assist the OS in allocating the appropriate scheduler. It can also be used to analyse the amount of CPU time required and send notifications to the user.

Syntax:

A JCL JOB statement's fundamental syntax is shown below.

//Job-name JOB Positional-param, Keyword-param  

10. What are the JCL procedures?

JCL Procedures are a group of statements contained within a JCL file. The statements in this section are grouped together to fulfil a certain task. A procedure is used to code the fixed parts of the JCL, while the JCL is used to code the variable parts of the Job.

With the help of several input files, we can use a procedure to parallelize the execution of a programme. Each input file can have its own JCL, and by giving the name of the input file as a symbolic parameter, a single operation can be called simultaneously.

Syntax:

A JCL procedure definition's core syntax

//*  
//Step-name EXEC procedure name

11. Explain how you will check the syntax of JCL without running it.

To check JCL syntax without running it, use TYPERUN=SCAN on a job card or use JSCAN. To request further job processing, such as examining or scanning a job for syntax errors, use the TYPRUN command. Without actually running the task, SCAN checks it for syntax errors. JSCAN can also inspect a JCL's syntax without running it.

12. Explain the JCL EXEC statement?

A JCL can have multiple job stages, each of which can either execute a programme or invoke a procedure. As a result, JCL may run multiple programmes at the same time (job steps).

The EXEC statement is the statement that holds the job step programme data.
The EXEC statement's purpose is to give the necessary data. This data is passed along to the job step's programme.

Syntax:

The following is the fundamental syntax for a JCL EXEC statement.

//Step-name EXEC Positional-param, Keyword-param  

13. Explain utilities in JCL.

JCL utilities are pre-written programmes that system programmers and application developers employ to satisfy day-to-day needs, organise data, and manage it. They are used to reorganise, change, or compare data at the record or data set level. Here is a couple of them, along with descriptions of their functions:

  • IDCAMS: IDCAMS is primarily used for defining and administering VSAM data sets and integrated catalogue facilities catalogues, however, it has other uses.
  • IEBCOPY: This software replicates one or more dataset members to a new or existing PDS dataset. PDS is compressed, PDS is loaded to TAPE, and PDS is unloaded from TAPE onto DISK.
  • IEBGENER: It is also a programme for converting TAPE files to DISK and vice versa. It is commonly used for copying or printing consecutive data sets.
  • IEBUPDTE: Within a partitioned data set, this function can create new members or edit records in existing members. This is mostly used to build and maintain assembler macro libraries and JCL procedure libraries.
  • IEHMOVE: It is commonly used to transfer data between volumes.
Related Article: VSAM Interview Questions

14. Name different JCL statements that are not permitted in the procedures.

The process does not allow the following JCL statements:

  • JOB, Delimiter(/*), or Null statements
  • JOBLIB or JOBCAT DD statements
  • DD * or DATA statements
  • Any JES2 or JES3 control statements
Related Articles: MainFrames Interview Questions

15. What are the different parameters for DD (Data Definition) statement?

The following are some of the DD statement's parameters. You can choose one or more parameters separated by commas based on your requirements.

DSN Parameter: It's used to give a dataset a name, whether it's new or old. The DSN value can have a total of 44 characters. The sub-names can be anywhere from one to eight characters long, separated by periods.

Syntax:  

DSN=Physical Dataset Name

Here,

  • The DSN parameter is specified via the term DSN.
  • The name of the freshly formed or existing dataset is referred to as the physical dataset name.

DISP Parameter: The keyword parameter "DISP" is used in JCL to represent the state of a data set to the operating system. It basically tells the operating system how to deal with the dataset after the JOB/STEP has finished. The status, normal, and abnormal JOB termination actions are the three sub-parameters.

Syntax:

DISP=({status},{normal Disposition},{abnormal Disposition})

Here,

  • The Disposition parameter is specified by the term DISP.
  • NEW (indicates that the dataset is new), OLD (indicates that the dataset exists when the step begins. ), MOD (extends an existing dataset or generates a new one if one does not exist. ), or SHR (indicates that the dataset
  • may be shared (read access) with other jobs.
  • After a normal termination, the normal disposition indicates what should be done with the dataset. CATLG, UNCATLG, PASS, KEEP, or DELETE are the possible values.
  • After a normal termination, the abnormal disposition specifies what to do with a dataset. It accepts the following values: CATLG, UNCATLG, KEEP, and DELETE.

DCB Parameter: The DCB (Data control block) parameter offers information about a dataset's physical properties. This parameter is necessary for freshly produced datasets.

Syntax: 

DCB=<List of parameters>

Here,

  • DCB is the name of the data control block parameter.
  • The record format of a dataset is specified by RECFM, the length of logical records is specified by LRECL, the size of a block of records is specified by BLKSIZE, and the data set's organisation is specified by DSORG as
  • physical sequential (PS), partitioned (PO), or direct (DA).

SPACE Parameter: The SPACE option specifies how much space is needed on a Direct Access Storage Disk to store a dataset.

Syntax:

SPACE=(Unit of Space,(Primary,Secondary,Directory),RLSE,CONTIG,ROUND) 

Here,

  • The word DCB refers to the data control block parameter.
  • TRK (tracks), CYL (cylinders), BLKLGTH (block length), and RECORDLENGTH (record length) are the space units (RECLGTH).
  • The fundamental space requirement is measured in space units (tracks/cylinders/number of data blocks).
  • The secondary quantity is indicated if the initial quantity of units is exceeded however, it is only assigned when the dataset increases.
  • The directory specifies the number of directory blocks to be allocated.
  • The RLSE gives the order to release the specified unused space.
  • Primary space should be assigned in a contiguous way, according to CONTIG.
  • ROUND designates a block length that is rounded to the allotment of integral cylinders.

SYSOUT Parameter: So far, we've looked at the parameters of DD statements that match to dataset data. SYSOUT sends data to the output device based on the class supplied.

Syntax: 

SYSOUT=class

16. Explain some of the commonly used parameters in the EXEC statement.

EXEC is an acronym for EXECUTION. The EXEC statement describes the execution of a program/job phase, as well as utilities and procedures.

Syntax:

//Step-name EXEC Positional-param, Keyword-param

The following are some of the most regularly utilised positional and keyword parameters in EXEC statements:

  • PGM: The name of the programme that will be run in the job phase is specified here.
  • PROC: The name of the procedure that will be run in the job step is specified here.
  • ACCT: It specifies the task step's accounting details.
  • ADDRSPC: It specifies whether real or virtual storage is required for job steps to execute.
  • COND: If the preceding task step fails abnormally, it provides conditions for conducting the following job steps. 
  • PARM: It gives the job steps parameterized data.
  • REGION: It indicates the amount of space or region size that should be assigned to a particular job/job phase.
  • TIME: It refers to a job's or a job step's time constraint.

17. State difference between JOBLIB and the STEPLIB statements.

The data processing centre (CPU). The OS must first look for and locate the application you specified before launching a JCL statement. A private library must be searched before seeking programmes in the system programme library. You must either specify the JOBLIB DD (Data Definition) statement or the STEPLIB DD (Data Definition) statement to allow OS to properly identify a programme in a private programme library.

JOBLIB and STEPLIB are two DD (Data Definition) statements. Despite the fact that both JOBLIB DD and STEPLIB DD specify a private library as the location of a certain programme, they behave differently in terms of OS search.

JOBLIB Statement: According to JOBLIB DD, every step of the JOB is searched in private libraries. It refers to the location of the JCL programme to be executed. After the JOB statement, but before the EXEC statement, comes this statement. It only applies to operations and programmes that run in the background.

Syntax: 

//JOBLIB DD DSN=dsnname 

Here,

  • The JOBLIB statement is specified by the term JOBLIB.
  • The Data definition statement is specified by DD.
  • The DSN identifies the program/job that will be run.

STEPLIB statement: According to STEPLIB, the sole single stage of the JOB is a search of private libraries. It refers to the location of the application that will be run within a Job Step. This remark comes after the EXEC statement but before the job step's DD statement.

Syntax:  

//STEPLIB DD DSN=dsnname 

Here,

  • The STEPLIB statement is specified by the term STEPLIB.
  • The Data definition statement is specified by DD.
  • The location of the step to be executed is specified by DSN.

18. Explain what you mean by Generation data group (GDG).

In JCL, the Generation Data Group (GDG) is a key notion. The GDG is made up of chronologically ordered groups of related data sets. Each of these interconnected groups has its own name. To make each data set inside a group distinct, a generation number and a version number are appended to the end of the name.

Syntax:

ABC.PQR.XYZ.GnnnnVmm  

ABC.PRQ.XYZ is the GDG basis in this case.

The Generation number (Value range 0000–99999) is represented by G, and the Version number (Value range 00–99) is represented by V.

Example: 

MYLIB.URMI.SAMPLE.G0001V00   
MYLIB.URMI.SAMPLE.G0002V00, and so on.

Here, the GDG base is MYLIB.URMI.SAMPLE

19. What are symbolic parameters and why is it required?

Any parameter that changes with each programme execution should be considered a symbolic parameter. The process becomes more versatile when symbolic parameters are used. The technique will not need to be changed each time a tiny, recurring change is performed at a specific location.

The string of 1 to 7 alphameric letters in symbolic parameters is preceded by an ampersand (&). After the &, you must include an alphabetic character. Symbolic parameters may only occur in the operand field of JCL statements, not in the name or operation fields. If there are several symbolic parameters supplied to a PROC or EXEC statement, only the first one is used.

20. What is the significance of the ADDRSPC parameter in the EXEC statement?

The ADDRSPC parameter is used to determine how much storage the system requires.

The following are some key points to remember regarding the ADDRSPC option.

  • It's a parameter that you can turn on or off.
  • Virtual or central storage options exist.
  • The REGION parameter asks for a single step to be saved.
  • Paging is disabled by ADDRSPC.
  • Paging is done with ADDRSPC=VIRT.
  • The step will be locked into actual storage once ADDRSPC is set to REAL(ADDRSPC=REAL).
  • It has a negative impact on the system's functionality.

21. What is the time parameter in JCL? Explain what does TIME=1440 mean?

The JCL TIME keyword parameter determines how long a job can use the CPU. TIME, in basic terms, provides the maximum amount of CPU time that can be used to complete the job. The TIME parameter can be coded at the Job and Step levels as well. When the set execution period has passed, the system will automatically terminate the JOB. As a result, the TIME parameter informs OS of the maximum CPU utilisation period, and once the job has spent the stated time, OS will automatically cancel the process.

Additional options for TIME Parameter 

  • TIME=1440
    It denotes that the task or stage has no time constraint and can be completed at any time.
  • TIME=MAXIMUM
    This indicates that the job or step can utilise as much CPU time as possible.

22. Explain the Msglevel parameter and its significance.

You can regulate or adjust the listing of the Job output for each specific job using the Msglevel parameter. It determines how allocation and termination notifications appear in the job output (SYSOUT). Msglevel is used to tell JCL which messages we want to print.

Syntax: 

MSGLEVEL=([statements][messages]) 

Here,

  • The numbering of statements can be 0, 1, or 2. (0 for Job-related statements, 1 for all JCL statements including procedures, and 2 for simply input JCL statements)
  • Messages can have a 0 or 1 digit number. (0 to hide all messages except return codes, i.e., allocation and termination, and 1 to display all messages, i.e., whether it's an allocation or termination, the spool will show all details)

23. What is a temporary dataset in JCL? How to create a temporary dataset?

Temporary datasets (files containing one or more records) are only needed for the duration of the job and are removed after it is finished. They only require storage for the duration of the job, after which they are removed. DSN=&& name or simply without a DSN is how these datasets are commonly expressed. We can use them to pass the output of one step to another in the same job.

24. Explain DD statement in JCL?

Datasets are mainframe documents that contain records that are formatted in a specified way. On the mainframe's Direct Access Storage Device (DASD) or Tapes, these files are the most basic data storage regions. If these data must always be examined in a packet programme, the physical dataset title and file type must be coded in a JCL.

The dataset definition for JCL may be found in the DD statement. Within a DD statement, the task step's required input and output resources must be specified. Dataset organisation, storage requirements, and record length must all be determined before using these resources.

Syntax

The following is the fundamental syntax for JCL DD.

//DD-name DD Parameters  

25. How can we convert a FB (Fixed block) file to VB (Variable block) file using a sort program?

You can convert an FB file to a VB file with SORT's FTOV option. This option converts fixed-length input records into variable-length output records. For RDW, VB files should include four extra bytes (Record Descriptor Word). As a result, the RDW (4 bytes) + the actual length of the record equals the length of the record in the VB file.

Example:

SORT parameters: 
SORT FIELDS=COPY                 
OUTFIL FNAMES=SORTOUT1,FTOV

SORTOUT1 is the VB output file in this case.
If you give it an 80-byte FB file, it will return an 84-byte VB file (4 bytes for RDW).

26. What are different ways in which data can be passed to a COBOL program from JCL?

To send data from JCL to COBOL, utilise the following methods:

  • SYSIN DD statement: Data can be entered directly into SYSIN or saved as a file. We may read that in COBOL by pressing the ACCEPT keystroke.
  • PARM parameter: We utilise PARM='Parameter value' in the JCL EXEC statement to send input from JCL to the programme. This can be done in COBOL's Linkage section.

JCL Interview Questions - For Experienced

27. What is the meaning of DISP=OLD and DISP=SHR?

DISP=OLD -> This is a reference to a previously produced dataset.
DISP=SHR -> It indicates that data can be shared by multiple users. It is, however, a read-only file.

28. What do you mean by Condition checking in JCL?

Yes, both at the task and step levels, condition checking is possible with JCL. Obviously, this is accomplished by combining the COND keyword with a JCL-defined return code and operand. In many programming languages (such as C, C++, Java, and others), the concept of conditional checking is analogous to the concept of (if-else).

Syntax:

COND=(RC,OP) 
COND=(RC,OP,STEPNAME) 
COND=EVEN 
COND=ONLY 

The letters RC, OP, and STEPNAME stand for Return code, Operator, and Step name, respectively.

RC can be given any number between 0 and 4095, however in most circumstances, it will be given a number between 0 and 16 as follows:

  • 0 (Successful execution of a program i.e., Normal execution).
  • 4 (Successful execution of a program with some warning).
  • 8 (Error)
  • 12 (Severe Error)
  • 16 (Fatal Error)
  • ‘OP’ can be any one of the following:
  • EQ (Equal to)
  • NE (Not Equal to)
  • LT (Less than)
  • LE (Less than or Equal to)
  • GT (Greater than)
  • GE (Greater than or Equal to)

29. Differentiate between Addressing mode and Run mode.

The following are the main distinctions between Addressing mode and Run mode.

Addressing mode or Access ModeRun Mode or Residency Mode
AMODE(24) denotes 24-bit memory addressing below the line.The RMODE(24) specifies that the programme must be loaded into memory below the line.
AMODE(31) denotes 31-bit memory addressing above and below the line.RMODE(31) indicates whether the programme should be loaded into memory above or below the line.
It defines either 24-bit or 31-bit addressing techniques when AMODE=ANY is used.RMODE=ANY indicates whether the programme should be loaded in 24-bit or 31-bit memory.

30. Which statement is used to identify the private libraries in JOB?

The JCLLIB statement is used to define the job's private libraries. It works with both catalogued and in-process procedures.

Syntax
The following is the fundamental syntax for a JCL JCLLIB statement.

//name JCLLIB ORDER=(library1, library2....)  

31. What happens when COND is coded in the JOB statement and EXEC statement?

A COND parameter can be added to a JOB statement or an EXEC statement in JCL. This option can be used to skip stages based on previous steps' return codes. The return code from the previous task phases is being tested here. If the test is found to be true, the current job step execution will be skipped. It is not an atypical termination to skip a task stage but rather an omission.

COND is coded in JOB statement: When COND is coded into a JOB statement, every step of the job is tested. If the condition is true at any given task stage, it is skipped along with the future steps.
COND is coded in EXEC statement: If COND is found to be true in the EXEC statement of a job step, only that job step will be skipped, and execution will proceed to the next job step. 
Example: 

//MATEKSD JOB MSGLEVEL=(1,1),NOTIFY=&SYSUID, COND=(0,NE)
//STEP01   EXEC PGM=CONDPGM1
//STEP02   EXEC PGM=CONDPGM2,COND=(0,EQ)
//STEP03   EXEC PGM=CONDPGM3,COND=(4,EQ)

Explanation of COND=(0 NE)
The COND parameter is set to (0,NE) at the JOB level, as you can see. It will verify if the return code 0 is not the same as the return code of any of the JCL stages. If this is the case, the position should be eliminated. As a result, this condition will be true and the task will be cancelled if any of the stages (such as STEP01, STEP02, or STEP03) returns a non-zero return code.

32. What do you mean by “Cond=even” and “Cond=only”?

CODE-EVEN: The current task step is executed regardless of whether the previous steps have ended unexpectedly when COND=EVEN is coded. If there are other RC conditions (return code conditions) coded alongside COND=EVEN, the job step will run even if none of them is true.

CODE-ONLY: The current task step will only be run if one of the preceding stages terminates abnormally, as indicated by the COND=ONLY code. If further RC conditions are coded alongside COND=ONLY, the job step will only run if none of the RC conditions is true and any preceding job steps have failed unexpectedly.

33. Explain DFSORT utility?

The IBM function DFSORT is quite useful. Datasets are copied, sorted, and merged using it. Input datasets are specified using the DD statements SORTIN and SORTINnn. Output data is determined using the SORTOUT and OUTFIL commands.

DFSORT is mainframe-only utility software for processing and manipulating sequential files using JCL.

34. Explain the usage of coding class parameters in JCL.

The CLASS keyword option in JCL is used to categorise the jobs that run in a specific OS installation. The operating system is informed about the nature of the work that is being submitted by CLASS. It avoids conflicts between jobs that share a resource. This type of parameter helps to balance the load of all the jobs executing in a given environment. It can also be used to prioritise job completion.

Syntax: 

CLASS= JOB-CLASS 

The following are the possible JOB-CLASS values:

  • Any character from A to Z
  • Any number from 0 to 9

Example:
    

//JCL1234 JOB ‘max021’,’Ashish’CLASS=A    

35. What do you mean by PROC? State difference between instream and a catalogued Proc.

PROC stands for Procedure. A JCL Procedure is a set of statements in a JCL file that accomplish a specific task. JCL Procedures work across several JCLs in the same manner as language compilers and linkage editors do. Instead of using the PROC keyword, the EXEC statement can be used to code the procedure directly.

Syntax:

//Step-name EXEC PROC=Procedurename
Or 
//Step-name EXEC Procedurename

Here,

  • The name given to step is specified by step-name.
  • The type of JCL statement is specified by EXEC.
  • PROC denotes the name of the procedure.

Example 1:

//STEP05  EXEC PROC=MTHPROC
 Or 
//STEP05  EXEC MTHPROC

Use of PROC

  • It eliminates coding that is done again and over again.
  • Code errors are no longer an issue.
  • Redundancy is eliminated.

Types of procedures

  • In-Stream Procedures: Procedures written in the same JCL are referred to as in-stream procedures. It should ideally start with a PROC and end with a PEND.
  • Cataloged Procedures: A catalogued procedure is one that is coded in a different datastore than the JCL.

36. Can you code instream data in PROC?

No, using instream data within a PROC is not possible. This is a set of guidelines. Before executing the PROC, it's usually best to add a few dummy statements and override the JCL's DD statements.

37. Explain NOTCAT 2- GS.

MVS sent a message. NOTCAT 2-GS denotes a duplicate catalogue entry. If we try to create a new dataset with dsn = 'xxxx.yyyy' using disp new, catlg, we will get this error.

The application will open and write, with the system attempting to place it in the system catalogue at the end of each phase. The catlg would fail and provide this warning since we already have an entry.

By removing the first data set and cataloguing the new dataset on the storage disc, we may solve the problem.

38. What is the usage of the Include statement in JCL?

A group of JCL statements coded inside a PDS (partitioned data set) member can be identified and included in a JCL stream using INCLUDE statements. Many of the common documents used in JCLs, for example, can be coded as DD statements in an INCLUDE member and used within JCL

Syntax:

//name INCLUDE MEMBER=member-name 

An INCLUDE statement does not contain a phoney DD statement, a data card specification, or JOB, PROC statements. With up to 15 layers of nesting, an INCLUDE statement can be coded within an INCLUDE member.

39. Explain DISP=(NEW,PASS,DELETE)?

To construct temporary data sets, we utilize DISP=(NEW, PASS, DELETE). DISP NEW builds a new data set and allocates space. DISP PASS moves the data set to the next step after the current step is successfully finished. DISP DELETE removes the accessible data set once the step abends, leaving only non-abended data sets.

40. How to run the COBOL program using JCL?

The programme must be written, as well as a load module containing all of the COBOL program's sub-programs for batch execution. When the JCL runs, it uses the load module instead of the actual programme. The load libraries are patched and sent to the JCL through JCLLIB or STEPLIB at the time of execution.

The below program will explain how to utilise JCL to run MYPROG using MYDATA.URMI.INPUT input file. This application creates two output files in the spool directory.

//COBBSTEP JOB CLASS=6,NOTIFY=&SYSUID  
//  
//STEP10 EXEC PGM=MYPROG,PARM=ACCT5000  
//STEPLIB DD DSN=MYDATA.URMI.LOADLIB,DISP=SHR  
//INPUT1 DD DSN=MYDATA.URMI.INPUT,DISP=SHR  
//OUT1 DD SYSOUT=*  

41. Does JCL support automatic restart?

Through the use of a preset keyword parameter, it is possible to have an automatic restart in JCL. One of the restarting keywords is RDkeyword. In most cases, it succeeds in causing the programme to end abruptly. In light of the importance of checkpoints, which are used to specify task execution at various stages in the programme, we must evaluate the location of the automatic restart.

42. What do you mean by abends in JCL? Write different JCL abend codes.

The operating system will be alerted about the work to be done in JCL using the SUBMIT command. When a programme ends abnormally during a step, it is called an abend. The following are some of the JCL Abend codes:

  • S0C4: A subscript that is out of range causes a storage violation error.
  • S0C5: An erroneous address specification, in which the address points to a control word, instruction, or data that cannot be cached, causes this.
  • S0C7: This mistake, also known as a Data Exception, is caused by bad data. This difficulty occurs whenever we transform an alphabetic field to a numeric computational field.
  • S222: When an operator cancels a job because the programme seeks a resource that is unavailable, this error occurs.
  • S237: When the volume's end is reached, this error occurs.
  • S322: The time allotted to a job, job step, or procedure has exceeded the limit, resulting in a Timeout error.
  • S522: This error happens when the waiting state exceeds the time limit set by the installation.
  • SB37: When there is insufficient disc space, this error occurs (End of volume with no further volume specified)
  • SD37: When there is insufficient disc space, this error occurs (the secondary allocation has not been specified).
  • SE37: When there is insufficient disc space, this error occurs (max. 16 extents are currently allocated).

43. How do you submit a job for execution?

When working on a mainframe, we must compose a Job and send it to the computer for processing. This is referred to as "submitting a job."

You can submit a JOB from your CICS application software in a number of ways. We may achieve this by writing JCL straight to JES Spool using CICS Spool Interface instructions.

44. How to submit a JCL from CICS?

CICS is used to access MVS's JES (job entry subsystem). CICS programmes use the JES interface to produce spool files and retrieve them. In order to use the JES interface in CICS, the DHFSIT SPOOL option must be set to YES (DFHSIT SPOOL=YES).

The four SPOOL interface commands used in a job submission are provided by CICS. The following are the details.

  • SPOOLOPEN (INPUT|OUTPUT)
  • SPOOLREAD
  • SPOOLWRITE
  • SPOOLCLOSE

Complete all-access to a JES spool file in a single task in a CICS programme. Any job that performs I/O on data sets with more than 1000 records is likely to have an impact on the rest of CICS' performance.

45. Does JCL support Automatic start? If yes, then explain how.

A preset keyword parameter, such as RD (Restart definition), can be used to restart JCL automatically. However, this frequently leads to sporadic programme termination. The restart definition (RD) immediately starts the job at the checkpoint. Checkpoints are used as markers for the job's execution at certain points. RD starts by looking for the last successful checkpoint and working his way backwards.

46. How do you explain the term job time-out and what can you do to overcome it?

A job timeout occurs when a programme takes longer than the stated time limit for the selected class. It's commonly known as an "S322 abend." Due to circling errors, the programme does not finish in this case.

If the amount of data handled by the programme is really large and requires additional time to complete, the TIME parameter can be coded as TIME = 1440.

47. What does DISP=(NEW,CATLG,KEEP) mean?

DISP Fresh allocates new memory and creates a new dataset. When the phase is completed, DISP CATLG can catalogue the data set. If the step abends/fails, DISP DELETE deletes the dataset.

48. What does DISP=(NEW,CATLG,KEEP) for a DSN mean?

DISP Fresh allocates new memory and creates a new dataset. When the phase is completed, DISP CATLG can catalogue the data set. A catalogued dataset can be referred to by name without requiring the user to indicate its location. The dataset is saved with DISP KEEP. The catalogue is not saved if the step fails. The three actions are dependable and ensure that the data set is always handled correctly.

49. If you have seven jobs to do, but you want to hold one at the same time, how can I accomplish this?

Following a set of predetermined rules is all it takes to get a job among the available ones. Each work has a keyword defined by JCL's predefined job rules. A job can be held for later execution if TYPRUN is mentioned in the job declaration. The TYPRUN is currently holding a job with the variable name HOLD.

50. What is the best way to check if a file is empty in JCL?

You can identify one empty file with JCL, but you must ensure that it is an IDCAMS input. VSAM (Virtual Storage Access Method) datasets are created, modified, and deleted using IDCAMS (Integrated Data Cluster Access Method Services). If the file is empty, an error is thrown (return code 4, i.e., RC=4) when it is entered into IDCAMS.

Course Schedule
NameDates
IBM Cognos Framework Manager TrainingOct 08 to Oct 23View Details
IBM Cognos Framework Manager TrainingOct 12 to Oct 27View Details
IBM Cognos Framework Manager TrainingOct 15 to Oct 30View Details
IBM Cognos Framework Manager TrainingOct 19 to Nov 03View Details
Last updated: 04 Apr 2023
About Author

 

Madhuri is a Senior Content Creator at MindMajix. She has written about a range of different topics on various technologies, which include, Splunk, Tensorflow, Selenium, and CEH. She spends most of her time researching on technology, and startups. Connect with her via LinkedIn and Twitter .

read less