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

Thursday, 1 June 2023

The Importance of Mainframe Skills: Unlocking the Power of COBOL, JCL, VSAM, CICS, DB2, CA7, and More.


Mainframe Skills
Mainframe Skills


Introduction

In the ever-evolving landscape of technology, certain skills continue to remain relevant and in high demand. Among these, mainframe skills such as COBOL, JCL, VSAM, CICS, DB2, CA7, and others hold immense importance. Despite the emergence of newer technologies, mainframe systems continue to power critical applications across industries worldwide. This article explores the significance of mainframe skills and why mastering these technologies can lead to lucrative career opportunities.

Mainframe Skills Overview

Before delving into the specific skills, it is essential to understand the broader concept of mainframe computing. Mainframes are high-performance computers that process vast amounts of data and handle complex transactions. They have been the backbone of large-scale business applications for decades, ensuring reliability, security, and scalability.

The Significance of COBOL

The term COBOL stands for Common Business-Oriented Language. It's one of the robust programming languages, that is designed for business applications. Despite being introduced in the late 1950s, COBOL remains prevalent in legacy systems. Many critical business operations, including financial transactions, healthcare systems, and government databases, rely on COBOL. Proficiency in COBOL opens doors to maintaining and modernizing these mission-critical applications.

Mastering JCL for Mainframe Success

JCL (Job Control Language) is a scripting language used to control and manage batch processing on mainframe systems. It defines the sequence of jobs and their dependencies, allocating system resources and directing data flow. JCL expertise is crucial for ensuring the efficient execution of batch jobs, optimizing system resources, and maintaining job schedules.

Understanding VSAM and Its Importance

VSAM (Virtual Storage Access Method) is a data management system used on mainframe systems. It provides efficient access to large volumes of data, offering features like random and sequential access. VSAM skills are vital for managing large databases and optimizing data retrieval and storage, enabling organizations to handle substantial amounts of information effectively.

Harnessing the Power of CICS

The CICS stands for Customer Information Control System. It's an online transaction processing system used on IBM Mainframes. It enables the execution of online transactions, serving as a bridge between users and back-end systems. Proficiency in CICS allows developers to design and develop interactive and responsive applications, ensuring smooth user experiences in real-time environments.

Leveraging the Potential of DB2

DB2 is a widely used relational database management system (RDBMS) on mainframes. It offers robust features for data storage, retrieval, and manipulation, providing the foundation for critical business applications. Mastering DB2 allows professionals to design and manage complex databases, ensuring data integrity, security, and efficient data access.

Navigating CA7 for Efficient Job Scheduling

CA7 is a job scheduling software used in mainframe environments. It enables the automation and coordination of batch jobs, ensuring the smooth execution of critical business processes. Knowledge of CA7 facilitates efficient job scheduling, resource optimization, and error handling, enhancing overall system performance and productivity.

The Benefits of Mainframe Skills in Today's World

Despite the growing popularity of cloud computing and distributed systems, mainframe technology continues to play a vital role in various industries. Mainframe systems excel in handling high-volume transactions, providing robust security, and offering unparalleled reliability. Organizations rely on mainframes to process sensitive data, run complex calculations, and ensure uninterrupted business operations. Therefore, possessing mainframe skills opens up a plethora of benefits and opportunities for professionals.

Industry Demand for Mainframe Professionals

The demand for mainframe professionals remains steady in sectors such as banking, insurance, healthcare, government, and retail. Many organizations heavily invest in mainframe systems, as they recognize the value of these robust and secure platforms. Consequently, there is a consistent need for skilled mainframe experts who can maintain, modernize, and optimize existing systems.

Job Opportunities for Mainframe Experts

Professionals with mainframe skills have a wide range of job opportunities at their disposal. They can work as COBOL programmers, JCL specialists, DB2 administrators, CICS developers, system analysts, mainframe architects, and more. These roles often come with attractive compensation packages and provide stability due to the industry demand for mainframe expertise.

Future Prospects and Growth

Contrary to the misconception that mainframes are fading away, they continue to evolve and adapt to changing technological landscapes. Mainframe vendors consistently innovate, integrating new capabilities and technologies into their systems. As a result, professionals with mainframe skills can stay relevant by embracing emerging trends such as cloud integration, mobile computing, and advanced analytics.

Training and Learning Resources

For those aspiring to acquire or enhance their mainframe skills, numerous training programs and resources are available. IBM offers a range of mainframe-related certifications and training courses, equipping individuals with the knowledge and expertise needed to excel in the field. Online platforms, educational institutions, and professional communities also provide learning opportunities to master mainframe technologies.

Conclusion

Mainframe skills like COBOL, JCL, VSAM, CICS, DB2, CA7, and others continue to hold immense importance in today's technology landscape. These skills provide professionals with a competitive edge and open up a world of career opportunities. By embracing mainframe technologies, individuals can contribute to the efficient functioning of critical business applications and secure their positions in a dynamic and evolving industry.

FAQs

Q: Are mainframe skills still relevant in today's era of cloud computing?

A: Absolutely! Mainframe systems excel in handling high-volume transactions and ensuring robust security, making them indispensable in various industries.

Q: Which industries rely heavily on mainframe systems?

A: Sectors such as banking, insurance, healthcare, government, and retail heavily depend on mainframe systems to process critical business operations.

Q: What are the job prospects for professionals with mainframe skills?

A: Mainframe professionals have a wide range of job opportunities, including roles such as COBOL programmers, JCL specialists, DB2 administrators, and system analysts.

Q: Can mainframe skills help in future career growth?

A: Yes, mainframes continue to evolve and integrate new technologies, providing opportunities for professionals to stay relevant and embrace emerging trends.

Q: Where can I learn mainframe skills and enhance my knowledge?

A: You can check out our Mainframe Course on Udemy and Skillshare. Additionally, IBM offers certifications and training courses for mainframe technologies. 

JCL Course
Mainframe JCL Course


Check out our COBOL Complete Reference Course, which is available on Udemy and Tutorial Point. You can also check out our Youtube Channel for more such videos. 

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™


Wednesday, 10 April 2019

How to schedule a job for a specific system?


JCL
How to schedule a job for a specific system?
As you might be aware, JES2 and JES3 can be used to manage a multiprocessor network that consists of more than one system.

In a multiprocessor network, each system operates under the control of its own copy of OS/390 or ZOS. 

However, the JES components of each processor’s operating system are connected in various ways to the JES components of the other processors, and a common spool is used to service all the processors in the network.

IBM Architecture.
IBM Mainframe Architecture 


As a result, JES2 and JES3 can control how jobs are processed by the systems within the multiprocessor network.
  • The term system affinity can be used to describe the relationship between a job and the system on which it executes.
  • Under JES2, you use the SYSAFF parameter of the /*JOBPARM statement to specify system affinity. 
  • Under JES3, you use the SYSTEM parameter of the //*MAIN statement.

The global processor is the processor that’s in charge of the entire network. A local processor is one that’s controlled by the global processor.

The syntax for the SYSAFF parameter of the JES2 /*JOBPARM statement

SYSAFF= {*} {(system-name,…)} {ANY}

Explanation


*

The job will run on the system that reads it (the default).

system-name

A one- to four-character system-id defined in the multiprocessor network that identifies which processor will run the job. If more than one system-name is specified, the job can run on any one of the processors listed.

ANY

The job can run on any available processor.

The syntax for the SYSTEM parameter of the JES3 //*MAIN statement

SYSTEM= {[/](main-name,…)} {JGLOBAL} {JLOCAL} {ANY} 


Explanation


main-name

A system-id defined in the multiprocessor network that identifies which processor will be used to run the job. If more than one main-name is specified, the job can run on any one of the processors listed.

/

The job can run on any processor except the one(s) listed.

JGLOBAL

The job must run on the global processor.

JLOCAL

The job can run on any local processor.

ANY

The job can run on any available processor.

Specifying system affinity

Under JES2

/*JOBPARM  SYSAFF=MVSA
/*JOBPARM  SYSAFF=(MVSA,MVSB)
/*JOBPARM  SYSAFF=ANY

Under JES3

//*MAIN    SYSTEM=(MVSA,MVSC,MVSD)
//*MAIN    SYSTEM=JLOCAL
//*MAIN    SYSTEM=/MVSB



Share Blog
Mainframe-Forum

Tuesday, 9 April 2019

How to create and use cataloged procedures.

In-stream procedure
JCL Catalog Procedure's
A JCL cataloged procedure (or just procedure) is a pre-written segment of code consisting of one or more job steps that you can include in a job stream. 

By using procedures/JCL catalog procedure, the amount of JCL coding you have to do is reduced, resulting in fewer coding errors and greater productivity.

Definition of cataloged procedure. 

A cataloged procedure is a series of JCL statements that are stored in a partitioned data set and may be invoked by any job on the system.

Typical types of cataloged procedures

  • IBM-supplied procedures that compile, link, and run programs
  • JCL steps that back up, delete and define VSAM files
  • Programs that are required by many jobs
  • Large jobs where it makes sense to separate the steps into manageable procedures.
Important Points:
Cataloged procedures are stored in partitioned data sets and can be invoked by any job on the system. When you invoke a cataloged procedure, the system looks for it in the system procedure library, SYS1.PROCLIB, unless you specify otherwise.

The syntax for invoking a JCL procedure


EXEC [PROC=]procedure-name

Explanation

procedure-name Identifies the procedure to be called and executed. For cataloged procedures, it’s the member name of the procedure. For in-stream procedures, it’s the name on the PROC statement that begins the procedure.

Example:

A job that invokes a cataloged procedure


//RC01RN JOB (45512),'R ROGGER',NOTIFY=RC01
//STEP1 EXEC TMP3000
//


The cataloged JCL procedure named TMP3000 that is invoked


//TMP3000  PROC 
//TMP3010 EXEC PGM=EMP33010
//SYSOUT  DD SYSOUT=*
//INVMAST DD DSNAME=RCA2.INVE.MASTER.FILE,DISP=SHR
//INVSEL  DD DSNAME=&&INVSEL,DISP=(NEW,PASS),
//           UNIT=SYSDA,SPACE=(CYL,(20,10))
//SELCTL  DD DUMMY
//INV3020 EXEC PGM=EMP3020
//SYSOUT  DD SYSOUT=*
//INVMAST DD DSNAME=&&INVSEL,DISP=(OLD,DELETE)
//INVSLST DD SYSOUT=*


JCL


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

Mastering the IEHMOVE Utility: Your Guide to Effortless Mainframe Data Management.

JCL IEHMOVE

IEHMOVE Utility

Introduction

Mainframe systems are the backbone of many large enterprises and are known for their power and reliability in handling mission-critical data. Among the essential tools used by mainframe systems administrators and programmers is the IEHMOVE utility.

IEHMOVE offers a streamlined way to move or copy datasets within the mainframe environment. Let us deep-dive into the power of IEHMOVE and how it simplifies data management tasks.

What is IEHMOVE?

The IEHMOVE is a system utility used to move or copy logical collections of operating system data. It is important to note that the information on IEHMOVE is provided for compatibility purposes only. Its primary functions are:
  • Moving datasets: Relocating datasets from one volume or device to another.
  • Copying datasets: Creating a duplicate dataset on the same or a different volume.
Instead of IEHMOVE, DFSMSdss should be used to move or copy data to volumes managed by the Storage Management Subsystem. To process Partitioned Data Set Extended (PDSE) datasets, DFSMSdss or IEBCOPY should be used.

IEHMOVE is a system utility that moves or copies logical collections of operating system data. IEHMOVE utility cannot be used with PDSEs, ISAM, VSAM data sets, or large-format sequential data sets.

Why Use IEHMOVE?

There are some key differences to remember regarding moving or copying data sets. A move operation will erase the source data if it resides on a direct access volume and the expiration date has passed, while a copy operation will leave the source data intact. 

Additionally, if the data set is cataloged, a move operation will update the catalog to refer to the moved version (unless otherwise specified). In contrast, a copy operation won't change the catalog.

IEHMOVE provides several critical advantages for mainframe data management:

  • Efficiency: IEHMOVE streamlines moving or copying datasets, mainly when dealing with large datasets or multiple volumes.
  • Automation: It integrates seamlessly into JCL scripts, automating routine data management tasks.
  • Dataset Groups: It enables working with groups of non-VSAM datasets cataloged in an integrated catalog facility.
  • Volume Handling: IEHMOVE can efficiently move an entire volume of datasets.

Important Considerations.

While IEHMOVE is a powerful utility, here are some points to remember:
  • Modern Alternatives: IBM recommends using DFSMSdss for data movement and copying within SMS (System Managed Storage) environments.
  • Format Compatibility: IEHMOVE primarily works with sequential, partitioned, and BDAM datasets. It is not designed for VSAM, PDSEs, ISAM, or large-format sequential data sets.


IEHMOVE in Action: A Basic Example

Let us illustrate a simple use case of the IEHMOVE utility:

//JOBCARD JOB ... (Job Accounting Information)
//STEP01 EXEC PGM=IEHMOVE
//SYSUT1 DD UNIT=SOURCE,VOL=SER=SRC001,DISP=OLD
//SYSUT2 DD UNIT=TARGET,VOL=SER=TGT001,DISP=(NEW,CATLG,DELETE)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
  MOVE DSNAME=USER.DATA.*,VOL=SER=SRC001,TONEWVOL=SER=TGT001
/*

Explanation:

  • SYSUT1: Defines the source volume (SRC001) containing the datasets to be moved.
  • SYSUT2: Defines the target volume (TGT001) where the datasets will reside.
  • SYSPRINT: Directs output messages.
  • SYSIN: Contains control statements. The MOVE command specifies that datasets match the pattern USER.DATA.* The source volume will be moved to the target volume.

Advanced IEHMOVE Techniques.

IEHMOVE offers additional options and features for more precise data management:
  • Selective Moves/Copies: Control statements help filter datasets based on names or patterns.
  • Renaming: Rename datasets during the process.
  • Multi-Volume Datasets: Efficiently handle datasets spanning multiple volumes.

Conclusion.

The IEHMOVE utility, though somewhat legacy for modern mainframe environments, remains a valuable tool for system administrators and programmers. Understanding its capabilities lets you streamline data management tasks within your mainframe system.

Call to Action.

Did you use IEHMOVE in your mainframe? Share your experiences and tips in the comments below.

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

► Youtube
► Facebook 
► Reddit

Thank you for your support. 

Mainframe Forum™

The JCL XMIT Statement: A Step-by-Step Guide.

XMIT JCL, How to use JCL XMIT statement
JCL XMIT Statement


Introduction.

The JCL XMIT statement is a powerful feature in Job Control Language (JCL) that plays a vital role in facilitating seamless data transmission between different JES (Job Entry Subsystem) or non-JES nodes. As a programmer, you must understand the syntax, and usage of the XMIT statement. 

In this article, we will explore how to use the JCL XMIT statement, provide examples illustrating its application, and delve into its syntax to ensure accurate implementation. Additionally, we will address the top five questions related to the JCL XMIT statement, providing valuable insights into this fundamental component of JCL data transmission.


Improving Data Transmission Efficiency with the XMIT Statement.

The XMIT statement is a powerful tool in JES2 that allows users to send jobs or data streams to other JES or non-JES nodes. Unlike other statements, the XMIT statement does not execute the job itself; instead, it facilitates the transmission of data to another node. 

Understanding the XMIT Statement.

The primary purpose of the XMIT statement is to transmit records from a JES2 node to either another JES2 node or an eligible non-JES2 node. For instance, it can be used to send data to VM or JES3 nodes. Notably, JES2 does not process or validate the records for JES2-specific requirements; it focuses solely on transmitting the data.

Building Header and Trailer Records.

Before transmitting the records, JES2 constructs header and trailer records based on the information provided in the JOB statement immediately preceding the /*XMIT statement. These records serve as markers and assist in data transmission. Once the header and trailer records are generated, JES2 transmits all the records that follow the /*XMIT statement.

Records and Transmission Types.

The records sent through the XMIT statement can be either a job input stream or an in-stream DD * or DD data set. If the records exist within a job input stream and the destination node has the capability to process Job Control Language (JCL), the transmitted input stream will be executed under the following conditions:

The record immediately following the /*XMIT statement must be a valid JOB statement at the destination node.

The input stream should solely consist of the JCL and associated data for the job referenced by the JOB statement.

However, it is crucial to note that if an NJE (network job entry) receiver detects multiple JOB statements within the input stream, all jobs will be flushed.

Determining the End of Records.

Several conditions dictate the end of records when utilizing the XMIT statement:
  1. The presence of the /* delimiter in the input stream.
  2. The identification of a two-character delimiter is specified using the DLM parameter on the /*XMIT statement.
  3. Exhaustion of card images within the input stream.
  4. Closure of the internal reader if records are being read from it.
  5. Syntax and Parameters

The /*XMIT statement follows a specific syntax and may include optional parameters. Here is an example illustrating the syntax:

/*XMIT {Nnnnn} [DLM=xx]
        {nodename}
        {nodename.userid}
        {nodename:userid}
        {nodename/userid}
        {nodename(userid)}
        {nodename.vmguestid}
        {nodename:vmguestid}
        {nodename/vmguestid}
        {nodename(vmguestid)}
        {name}

The /XMIT statement begins with the characters / in columns 1 and 2, followed by XMIT in columns 3 through 6. Starting from column 8, you can specify the node-name or node-number. Optionally, you can include a delimiter parameter, preceded by a blank, if desired. It's important not to continue an /*XMIT statement beyond the specified format.

JCL XMIT Usage Example.

Here are a few examples demonstrating the usage of the /*XMIT statement in different scenarios:

Example 1: Transmitting from JES2 to another node

//RU0001T JOB (00034),’RC’,CLASS=A,
JES2 /*XMIT node-name,DLM=XX
JES3 //*XMIT DEST=node-name,DLM=XX,SUBCHARS=YY
JCL // XMIT DEST=node-name,DLM=XX,SUBCHARS=YY only in JES3
Lines if data
/*

The Parameter is as follows : 

  • Node-name: names the node to which data need to be sent.
  • DLM=XX: is optional and changes the delimiter character from /* to two characters you specify.
  • SUBCHARS= YY: is also optional and specifies replacement characters to be used for the first two characters of any /*EOF or /*DEL internal reader control statement that is transmitted as lines of data so that they will not be executed.

Question 1: What is the JCL XMIT statement?

The JCL XMIT statement is a powerful feature in JCL (Job Control Language) that facilitates the transmission of data or jobs from one JES (Job Entry Subsystem) or non-JES node to another. It allows users to send data streams or job input streams, along with associated Job Control Language (JCL), to a target node for processing.

Question 2: How do I use the JCL XMIT statement?

To use the JCL XMIT statement, you need to include it in your JCL code. The statement starts with /*XMIT, followed by the necessary parameters such as node-name or node-number. Optionally, you can include additional parameters like the delimiter (DLM) parameter to specify a custom delimiter for the transmission. It is important to ensure that the transmitted input stream adheres to the required format at the destination node.

Question 5: What are some common errors that can occur when using the JCL XMIT statement?

When using the JCL XMIT statement, it is important to ensure proper syntax and adherence to the requirements of the target node. Common errors that can occur include:
  • Missing or incorrect node-name or node-number parameter.
  • Improper usage or placement of the /*XMIT statement within the JCL code.
  • Incompatible JCL or data formats between the transmitting and receiving nodes.
  • Failure to specify the appropriate delimiter or using an invalid delimiter.
  • To avoid these errors, carefully review the JCL code and verify compatibility between the transmitting and receiving nodes, ensuring adherence to the required format and parameters.

Question 6: What is the JCL XMIT Statement and How to Use It?

The JCL XMIT statement is a crucial feature in Job Control Language (JCL) that enables efficient data transmission between different JES (Job Entry Subsystem) or non-JES nodes. By utilizing the XMIT statement, users can easily send data streams or job input streams, including associated JCL, from one node to another.

Summary.

The JCL XMIT statement is a powerful feature in Job Control Language (JCL) that enables efficient data transmission between JES (Job Entry Subsystem) and non-JES nodes. The XMIT statement allows users to transmit job input streams or data streams to target nodes, facilitating seamless data exchange. Understanding the syntax and correct implementation of the XMIT statement is crucial to ensure successful data transmission. By leveraging the capabilities of the XMIT statement, users can enhance their data transmission processes and optimize the efficiency of their JCL workflows.

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