Showing posts with label JCL tutorial. Show all posts
Showing posts with label JCL tutorial. Show all posts

Saturday, 3 April 2021

JCL Interview Questions and Answers | Mainframe Interview Questions [JCL Tutorial].

 

JCL Interview Questions, JCL tutorial, JCL

JCL Interview Questions.

Welcome back to today's JCL Interview Questions session. In this session, you'll go through the top 10 JCL Interview Questions. These questions focus on generation data groups (GDG), VSAM, and other JCL tricks. These JCL interview questions are a quick refresher for both experienced and freshers. Let's get started with JCL interview questions with answers.

Introduction to JCL.

The term JCL stands for Job Control Language. It's the command language of the z/OS operating system and it provides information related to the program and the datasets. JCL has three types of control statements i.e. JOB Control statement, Execute Statement, and DD statements.

Now, let's go through the top 10 JCL interview questions. 

What is the purpose of the PARM parameter in the EXEC statement? 

The PARM parameter is a method to pass data from JCL to the COBOL program. The maximum length of the PARM parameter is 100 bytes (i.e. 100 characters). The JCL PARM parameter is specified in the EXEC statement. The following JCL PARAM example explains, how to pass data from JCL to a COBOL program. 

JCL PARM Parameter example: 

//STEP01 EXEC PGM=EMP01,PARM=‘11/11/2021' 

What is the importance of the REGION parameter in JCL and on which JCL statement you can define it?

The REGION parameter sets the value of central or virtual storage that the step wants.

When a job step begins, the system allocates a region of storage space, that’s large enough to hold the program and any required control blocks. As the program executes, it can enlarge its region by acquiring additional storage. 

You can use the REGION parameter on a JOB or EXEC statement, to control the maximum amount of storage, that can be acquired for a job step’s region. Although the system also allows you to code REGION=0K, or REGION=0M to allocate all available storage.

JCL REGION Parameter Example: 

//STEP01   EXEC PGM=EPTAX,REGION=0M      

What is the application of the TIME parameter in JCL?

The TIME parameter in JCL is used to define the maximum amount of time that a mainframe job/JCL may use the CPU processor. The mainframe system terminates the job if it exceeds the defined time limit. You can define the JCL TIME parameters on both the JOB CARD and EXEC control statements. 

TIME parameter on JOB and EXEC statements example.

//TPTOPIC01 JOB (99921),'TOPICTRICK',TIME=1440
//STEP01    EXEC PGM=EMP01,TIME=50
  ......
  ......


What is the difference between the data definition name (DD name) and the Data Set name (DSN name) in the DD statement?

Well, the DSN name is used to provide the physical dataset name. However, DD name (i.e. data definition name) is an eight-character logic name corresponding to the actual data-set name. DD name begins after the "//". In the COBOL programs, the DD name is used to perform I/O operations. 

For Example: 

//DDNAME DD DSN=TP.TAX.FILE.NAME,DISP=SHR

What is the DUMMY data set in JCL and How to allocate a dummy data set in JCL?

A dummy data set is a data set that doesn’t exist. Instead, the system simulates the data set, allowing a program to process the file without actually having the file present. There are two ways to specify a dummy data set on a DD statement. You can code the DUMMY parameter, or you can specify DSNAME=NULLFILE.  DUMMY is a positional parameter and, if coded, must be the first parameter on the DD statement.


For example: 


//ddname DD DUMMY 

//ddname DD DSNAME=NULLFILE 


What does the keyword DCB mean and what are some of the keywords?

The term DCB stands for data control block. It is a keyword for the DD statement used to describe data sets attributes. The parameters associated with it are BLKSIZE, LRECL, RECFM etc. 


For example: 


//TAXFLE DD DSNAME=TP.DAILY.TAX.FILE,    

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

            DISP=SHR


How to create a temporary dataset in JCL?

In JCL, you have the facility of creating a temporary dataset. As the name suggests the temporary dataset in JCL is created and removed in the same mainframe job/JCL. The temporary dataset in JCL is created in the following ways:

 

  • DSNAME=&&dsname ►For a temporary data set
  • DSNAME=&&dsname(member) ► For a member of a temporary PDS or PDSE
  • No DSNAME parameter ► For a temporary data set to be named by the system

What is the difference between IDCAMS REPRO, IEBGENER, and IEBCOPY utility?

Well, IEBGENER, IDCAMS REPRO, and IEBCOPY are data copy utilities that are widely used on Mainframe. However, the application of each utility is different.
  • IEBGENER utility in JCL: is generally used to copy sequential datasets PDS or PDSE member. You can also apply filter criteria; change logical records length and block size of a dataset, and generate records.
  • IEBCOPY utility in JCL: is generally used to merge or copy members between one or more PDS (i.e. partitioned data sets), or PDSE (i.e. partitioned data sets extended).
  • IDCAMS REPRO in JCL: is generally used to copy sequential datasets. It is primarily used while dealing with VSAM datasets.

What is the difference between STATIC CALL & DYNAMIC CALL?

In the case of STATIC CALL, the called program and the calling program are part of the same load module. The called program always resides in the main memory. The compiler option is NODYNAM.

In a DYNAMIC CALL, the called program is compiled and stored separately. The called program is loaded into the main memory when it is required. The compiler option is DYNAM.

What is the difference between INSTREAM PROCEDURE and CATALOGED PROCEDURE?

JCL Procedure is a pre-written set of statements. JCL procedures are of two types: 
  • INSTREAM procedure in JCL is a set of statements that are written between PROC and PEND statements. You can invoke the instream procedure by the JCL EXEC statement.
  • CATALOGED procedure in JCL is a pre-written set of statements, the cataloged procedure tested and stored as procedure library (i.e. PROCLIB). Cataloged procedure in JCL is invoked by the JCL EXEC statements.

JCL Interview Question and Answers.


Conclusion.

Finally, this marks an end to today's JCL Interview Questions and Answers. This tutorial highlights the top 10 JCL interview questions and answers. These questions cover multiple different topics from JCL (JOB Control Language). Do check out our blog for various JCL tutorials. 

Subscribe to Topictrick & Don't forget to press THE BELL ICON to never miss any updates. Also, Please visit mention the link below to stay connected with Topictrick and the Mainframe forum on - 

► Youtube
► Facebook 
► Reddit

Thank you for your support. 
Mainframe Forum™

Monday, 8 April 2019

JCL Tutorial: JCL TYPRUN Parameter | TYPRUN=HOLD in JCL [Mainframe JOB].



JCL Tutorial, JCL TYPERUN, TYPERUN in JCL
How to hold a JCL Job?

Welcome back to today's JCL Tutorial. In this session, you'll learn the basics of "TYPRUN=HOLD" in JCL and "TYPRUN=SCAN" in JCL. You'll also learn, how you can use the TYPRUN parameter to hold the mainframe job. Let's get started with today's JCL Tutorial Agenda.

    Agenda - JCL Tutorial.

  • JCL Introduction.
  • JCL TYPRUN Parameter.
  • JCL TYPRUN Syntax.
  • JCL TYPRUN Example.
  • Summary.

JCL Introduction. 

The term JCL stands for JOB CONTROL LANGUAGE. It's the command language of the Z/OS Operating System. JCL is generally used to provide information related to datasets and programs that need to be executed. 
 

Is it possible to hold a job? 

Well, the answer is yes, a mainframe job can be placed in a hold status so it won’t be scheduled for execution until an operator issues a command to release it. For example, you may want a run a job A until job B has been completed.

JCL TYPRUN Parameter.

JCL TYPRUN parameters are optional parameter and it is generally specified in JOB control statements. TYPRUN in JCL is primarily used to hold the mainframe job. You can also use JCL TYPRUN to scan mainframe jobs for syntax errors without executing the JCL. 

JCL TYPRUN Syntax. 

TYPRUN in JCL is pretty simple and easy to use. It has four possible following values. Let's look at each value in detail.

            TYPRUN={COPY}
                   {HOLD}
                   {JCLHOLD}
                   {SCAN}
  • When you specify TYPRUN=COPY, then JES2 is instructed to copy the input job stream as-is to an SYSOUT data set and schedule the SYSOUT data set for output processing.
  • When you specify TYPRUN=HOLD, the mainframe job is on hold until it is released by the operator.
  • When you specify TYPRUN=JCLHOLD, check for JCL error when the operator releases the job.
  • When you specify TYPRUN=SCAN, the system scans the mainframe job for syntax errors, without executing or allocating devices. 

JCL TYPRUN Examples.

As you that TYPRUN in JCL is optional and it is generally specified in the JOB control statement. JCL TYPRUN has four possible values. Let's try to understand each TYPRUN parameter with an example. 
 
Example 1: The TYPRUN parameter uses the HOLD option to hold a job in the queue until the operator issues a command to release it.

JCL TYPERUN=HOLD, JCL TUTORIAL

JCL TYPRUN=HOLD


Example 2: The JCLHOLD option is similar to the HOLD option except that the JCL is not checked for errors until the operator releases the job.

JCL Tutorial, JCL TYPERUN=SCAN, JCL TYPERUN=HOLD

JCL TYPRUN=JCLHOLD

Example 3: A held job class is specified in the CLASS parameter of the JOB statement. Once the operator changes the class, the job is released for processing.


JCL TYPRUN=SCAN

JCL TYPRUN=JCLHOLD


Example 4: A JES3 //*MAIN statement HOLD parameter is used to hold the job in the queue. This has the same effect as coding TYPRUN=HOLD on the JOB statement.

JCL TYPRUN, TYPRUN in JCL

JCL TYPRUN=JCLHOLD

In most production environments. Clients generally used workload schedular such as CA7, TWS, etc. But, you can still use TYPRUN in JCL to scan jobs for syntax errors or hold the mainframe job if you're running JCL outside the workload scheduler. 

Summary. 

Finally, this marks an end to today's TYPRUN in JCL Tutorial. In this session, you learn how to define and use TYPRUN parameters in JCL's. You also learn different variants of TYPRUN parameters. Don't forget to join us for the next tutorial on "How to write and execute Rexx Programs". Do checkout out CA7 Command Reference.

►Subscribe to Topictrick & Don't forget to press THE BELL ICON to never miss any updates. Also, Please visit mention the link below to stay connected with Topictrick and the Mainframe forum on - 

► Youtube
► Facebook 
► Reddit

Thank you for your support. 
Mainframe Forum™

Saturday, 10 August 2013

JCL IEHPROGM Utility and IEHPROGM utility examples [IEHPROGM Utility in JCL]


IEHPROGM Utility in JCL, JCL IEHPROGM

IEHPROGM Utility in JCL

Welcome back to today's session on IEHPROGM UTILITY in JCL. In this, session, you'll learn the basics of JCL IEHPROGM Utility and why is the purpose of IEHPROGM utility. You'll also learn how to use the IEHPROGM utility in JCL. Let's get started with the IEHPROGM utility.

Agenda.

  • Introduction.
  • What is IEHPROGM utility in JCL?
  • IEHPROGM utility examples.
  • Conclusion.

Introduction.

IBM mainframe is one of the oldest and most secure computing platforms. Most of the enterprise applications still run on Mainframe. The mainframe is the backbone of business computing.

IBM has supplied many mainframe tools and utilities such as IEHPROGM, IDCAMS, IEFBR14, IEBGENER, etc to facilitate programmers to complete there day to day tasks. You can easily invoke these JCL utilities by JCL. Let's deep dive into the IEHPROGM utility in JCL and learn different ways to accomplish day-to-day work.

What is IEHPROGM Utility in JCL?

In laymen's terms, the IEHPROGM utility in JCL is a system utility that is supplied by IBM. IEHPROGM utility is used to modify system key data and to manage data sets at an organizational level. 

The IEHPROGM utility in JCL is used essentially to handle catalogs, rename data sets, and delete data sets. However, most of the IEHPROGM functions are available by IDCAMS. The IDCAMS utility (i.e. Access method services is the preferred utility for catalog and data set functions.

The IEHPROGM is a system program and you must have relevant access in place to trigger the IEHPROGM utility via JCL.

You can use the JCL IEHPROGM utility for the following task. 

  • To delete a data set or a partitioned data set member.
  • To rename a data set or a partitioned data set member.
  • To manage data set passwords.

The following examples represent some of the uses of the JCL IEHPROGM utility. You can use the following table as a swift reference guide to IEHPROGM.

IEHPROGM Function. 

  • LIST, REPLACE
  • RENAME
  • RENAME, DELETE, ADD
  • RENAME, UNCATLG, CATLG
  • SCRATCH
  • SCRATCH, UNCATLG
  • UNCATLG

Now, let's deep dive into the IEHPROGM utility example to understand the function of the IEHPROGM utility in JCL. 

IEHPROGM Utility Example. 

#1. IEHPROGM RENAME. 

In this IEHPROGM example, a PDS member will be renamed.
  
//TPRCK99A JOB 'TOPICTRICK',MSGCLASS=A,CLASS=C,
//             MSGLEVEL=(1,1),NOTIFY=&SYSUID
//STEP01   EXEC PGM=IEHPROGM
//SYSPRINT DD  SYSOUT=*
//DD1      DD  VOL=SER=3390,DISP=OLD,UNIT=DISK
//SYSIN    DD  *
   RENAME VOL=DISK=3390,DSNAME=TP.PDS.COBB,
          NEWNAME=NABC,MEMBER=OABC
/*

The control statements are explained below:
  • DD1 DD represents a permanently mounted volume.
  • SYSIN DD determines the input data set, which follows in the input stream.
  • RENAME defines that member OABC in the partitioned data set will be renamed to  NABC.

#2. IEHPROGM SCRATCH. 

//TPRCK99A JOB 'TOPICTRICK',MSGCLASS=A,CLASS=C,
//             MSGLEVEL=(1,1),NOTIFY=&SYSUID
//STEP1    EXEC PGM=IEHPROGM
//SYSPRINT DD  SYSOUT=*
//DD2      DD  UNIT=disk,VOLUME=SER=3390,DISP=SHR
//SYSIN    DD  *
     SCRATCH  VTOC,VOL=disk=3390,SYS
/*

The control statements are explained as follows:


  • The DD2 statement describes a volume. 
  • The SCRATCH statement, with SYS named, indicates that all temporary system data sets.

Conclusion. 

Finally, this marks an end to the "IEHPROGM utility in JCL" session. In this session, you learned what is IEHPROGM utility is and why it is an important JCL utility. You also learned the different examples of the JCL IEHPROGM utility example. Lastly, what is the difference between the static calls vs dynamic calls in COBOL? Do check out COBOL LEVEL 88 Condition.


Subscribe to Topictrick & Don't forget to press THE BELL ICON to never miss any updates. Also, Please visit mention the link below to stay connected with Topictrick and the Mainframe forum on - 

► Youtube
► Facebook 
► Reddit

Thank you for your support. 
Mainframe Forum™

COND Parameter in JCL | JCL COND Examples | COND Conditional Job Processing | [JCL COND Parameter]


cond parameters in JCL

JCL COND Parameter

Welcome back to today's session on "COND Parameter in JCL". In this session, you'll learn the basics of the JCL cond parameter, how to use multiple cond parameters in JCL, and cond parameters override in JCL.

You'll reinforce your JCL COND parameter knowledge with basic JCL COND examples (i.e. JCL cond code to bypass step, JCL cond=(0 le), JCL condition codes interview questions, JCL cond=(0, NE), JCL cond=(4, lt)). Let's get started with an introduction to JCL.

JCL COND Parameter - Agenda.

  • Introduction to JCL.
  • What is COND Parameter in JCL?
  • What are Return Code (RC) and System code in JCL?
  • How COND Parameters in JCL work?
  • JCL COND parameters syntax.
    • JCL COND EVEN or JCL COND ONLY.
  • JCL COND Parameter Example - Summary.
  • COND Parameter in JCL Examples. 
  • Conclusion.

Introduction to JCL.

The term JCL stands for "JOB Control Language". It's the command language of the z/OS operating system. Ideally speaking JCL is a scripting language and it a combination of multiple job control statements (i.e. JOB Card, Execute Statement, and DD statements).

JCL has multiple steps and each check is a combination of the EXEC statement and DD statements. But, sometimes you the requirement to skip or execute certain job steps based on certain condition. The conditional execution of JOB steps is termed as conditional processing of JCL (i.e. JCL conditional processing).

What are COND Parameters in JCL?

In laymen's terms, the "JCL COND parameter" is one of the most important and vital parameters that is used for JCL conditional processing. However, you can also use the "IF/THEN-ELSE/ENDIF" statement to process job steps conditionally.

Now, before discussing the JCL COND syntax. Let's try to understand the difference between "Return code" and "System Completion Code".

What is Return Code (RC) in JCL?

An application program can return code at the end of the step termed as "Return Code or Completion Code". You can use these return codes in JCL cond parameters to either skip the processing or execute the steps.

What is System Completion Code in JCL?

The other category of code is "System Completion Code". In this category the operating system return code at the end of the job completion.

How COND Parameters in JCL works?

JCL COND parameter allows the execution of job steps depend on the return code (i.e. RC) from previous steps. For example, if a compilation fails, there is no need to attempt a subsequent linkage editor or execution step in the job. If the COND parameter in JCL is omitted then the system will execute all steps with a testing return code of the previous steps.

You can use the JCL COND parameter to specify the return code tests the system uses to decide whether a job will continue processing or terminates. Before and after each job step is executed, the system performs the JCL COND parameter tests against the return codes (i.e. RC) from completed job steps.

If none of these tests is satisfied, the system executes the job step (i.e. JCL conditional step execution); if any test is satisfied, the system bypasses all remaining job steps (i.e. "JCL COND code to bypass step") and terminates the job.

The tests are made against return codes (i.e. RC) from the current execution of the job. A job step is bypassed because an EXEC statement COND parameter does not produce a return code.

Bypassing a step because of a return code test is not the same as abnormally terminating the step. The system abnormally terminates a step following an error so serious that it prevents successful execution. In contrast, bypassing a step is merely its omission.

JCL COND Parameter Syntax.

The following is the syntax of COND parameters in JCL. 

COND=((code,operator)[,(code,operator)]...)

  • Code - The CODE parameter is used to specifies a number that the system matches to the return code (i.e. RC) from each job step. The return code value must be between 0 through 4095.
  • Operator - The operator parameter is used to specifies the type of comparison to be made to the return code (i.e. RC). If the specified return code is tested true, the system bypasses all remaining job steps (i.e. cond parameter to bypass a step in JCL). Following are the operator which is used to specify COND parameters in JCL. 


Operator          |            Meaning 
  GT                               Greater than
  GE                               Greater than or Equal to
  EQ                               Equal to
  LT                                 Less than
  LE                                 Less than or Equal to
  NE                                Not Equal to

If you code the COND parameter on the JOB statement and on one or more of the job's EXEC statements, and if a return code test on the JOB statement is satisfied, the job terminates. In this case, the system ignores any EXEC statement COND parameters.

If the tests on the JOB statement are not satisfied, the system then performs the return code tests on the EXEC statement. If an EXEC return code test is satisfied, the step is bypassed.

JCL COND EVEN or JCL COND ONLY. 

JCL COND parameter is more flexible on the EXEC statement than the COND parameter on the JOB statement. It lets you specify a return code (i.e. JCL COND=(0, NE)) and a relational operator (i.e. )to determine whether to skip a particular job step (i.e. JCL cond code to bypass step) instead of all subsequent steps.

Also, you can define a step name to test the return code (i.e. RC) for a specific job step. JCL COND parameter also provides two additional subparameters, EVEN and ONLY, that let you specify how an abend affects job step execution.

JCL COND parameter syntax on EXEC statement.

 COND=([(value,operator[,stepname])…]
       [ ,{EVEN} {ONLY}])

  • EVEN - Directs the system to execute the job step even if a prior job step is abended.
  • ONLY - Indicates the system to execute the job step only if a former job step is abended.

Important Point - You can code the JCL COND EVEN or JCL COND ONLY sub-parameters to specify which steps to be executed when the previous job step failed. 

JCL COND Parameter Example - Summary.  

In the following JCL COND example, you'll have a summary of the condition code and how the job step will behave to each condition code. 

JCL COND parameter | Return Code (RC) from the 
                         previous job step.

Continue job |  Terminate job
COND=(code,GT)    | RC >= code |  RC <  code
COND=(code,GE)    | RC > code |  RC <= code
COND=(code,EQ)    | RC ¬= code |  RC =  code
COND=(code,LT)    | RC <= code |  RC >  code
COND=(code,LE)    | RC < code |  RC >= code
COND=(code,NE)    | RC = code |  RC ¬= code

Now, let's deep dive into the cond parameters in JCL examples.

#1. COND parameter in JCL to skip a step or COND parameter to bypass a step in JCL.

In the following example, the STEP02 will be bypass if the STEP01 return code is 8 or greater than 8.
 
//TPTRICK01 JOB 'TOPICTRICK',MSGCLASS=A,CLASS=C,
//               MSGLEVEL=(1,1),NOTIFY=&SYSUID
//STEP01 EXEC PGM=SORT
//....
//....
//STEP02 EXEC PGM=EMPTAX01,COND=(7,LT) 
//....
//....
//

#2. Multiple conditions in COND Parameter in JCL.

In the following example, the STEP03 will be bypass if the STEP01 return code equal to 8 or STEP02 has a return code of 12 or greater. 

//TPTRICK01 JOB 'TOPICTRICK',MSGCLASS=A,CLASS=C,
//               MSGLEVEL=(1,1),NOTIFY=&SYSUID
//STEP01 EXEC PGM=SORT
//....
//STEP02 EXEC PGM=EMPTAX01
//....
//STEP03 EXEC PGM=EMPTAX02,COND=((8,EQ,STEP01),(12,LE,STEP02)) 
//....
//....
//

#3. JCL COND=EVEN Example.

In the following example, the STEP02 will be executed if the STEP01 has failed due to any reason. 

//TPTRICK01 JOB 'TOPICTRICK',MSGCLASS=A,CLASS=C,
//               MSGLEVEL=(1,1),NOTIFY=&SYSUID
//STEP01 EXEC PGM=SORT
//....
//....
//STEP02 EXEC PGM=EMPTAX01,COND=(EVEN) 
//....
//....
//


#4. JCL COND=ONLY Example.

In the following example, the STEP02 will be executed only if the STEP01 has failed due to any reason. 

//TPTRICK01 JOB 'TOPICTRICK',MSGCLASS=A,CLASS=C,
//               MSGLEVEL=(1,1),NOTIFY=&SYSUID
//STEP01 EXEC PGM=SORT
//....
//....
//STEP02 EXEC PGM=EMPTAX01,COND=(ONLY) 
//....
//....
//


#5. JCL COND parameter overrides in JCL Example.

If you want to implement the test to the return code (i.e. RC) from a specific step within a procedure, then you have to follow the sequence of sub-parameters (number, comparison, stepname.procstep).

In the following example, the system bypass STEP02, if 4 is less than the return code (i.e. RC) from the GO step of the TAXPROC procedure executed by step020.

//TPTRICK01 JOB 'TOPICTRICK',MSGCLASS=A,CLASS=C,
//               MSGLEVEL=(1,1),NOTIFY=&SYSUID
//STEP01 EXEC TAXPROC
//....
//....
//STEP02 EXEC PGM=REPTAX,COND=(4,LT,STEP01.GO) 
//....
//....
//

#6. JCL COND Override proc Example.

Let say, you require to override a step within the procedure to define the COND parameter for it. You can code sub-parameter in the following format - COND.PROCSTEP=(number,Comparison).

//TPTRICK01 JOB 'TOPICTRICK',MSGCLASS=A,CLASS=C,
//               MSGLEVEL=(1,1),NOTIFY=&SYSUID
//STEP01 EXEC TAXPROC,COND.GO(4,LT)
//....
//....
//

JCL COND - Return Code. 

0 |    Job/Step completed successfully. 
4 |    Minor errors detected but the job/step execution was successful.
8 |    Serious errors detected; Job/step execution likely to fail.
12 |    Serious errors detected; execution impossible.
16 |    Fatal error; job/step execution cannot continue.

Conclusion.

Finally, this marks an end to JCL Tutorial on "COND Parameter in JCL". In this session, you'll learn the basics of the JCL cond parameter, how to use multiple cond parameters in JCL, and cond parameters override in JCL. You'll reinforce your JCL COND parameter knowledge with basic JCL COND  examples (i.e. JCL cond code to bypass step, JCL cond=(0 le), JCL condition codes interview questions, JCL cond=(0, NE), JCL cond=(4, lt)).


Subscribe to Topictrick & Don't forget to press THE BELL ICON to never miss any updates. Also, Please visit mention the link below to stay connected with Topictrick and the Mainframe forum on - 

► Youtube
► Facebook 
► Reddit

Thank you for your support. 
Mainframe Forum™



JCL COND Parameter, COND PARAMETER
JCL COND Param.


Created with Artisteer

New In-feed ads