JCL Procedures & PROC's Using JCL Procedures |
The SimoTime Home Page |
JCL defines how a job is executed on the mainframe. A job may perform many steps or execute many programs in order to produce the requested information or output. If a segment of JCL is used repeatedly it may be coded once as a PROC (or JCL Procedure) and then used by many different steps within the job. There are two approaches to defining and using PROC's.
The PROC may be defined within the job (this is referred to as an In-stream PROC). If the segment of JCL code being defined as a PROC is unique to a single job then this approach is a very good alternative. An instream PROC should be defined first in the JCL before the EXEC statement that will reference the PROC. An instream PROC must start with a PROC statement and be terminated with a PEND statement. The PEND is not required if the PROC is stored as a separate member in a library.
The PROC may be defined as a separate member and stored in a separate library (i.e. PDS). If the segment of JCL code being defined as a PROC will be used by different jobs then this approach should be used.
At execution time when an EXEC statement references a PROC the PROC source code will be copied into the job and executed as if it is part of the JCL.
If you store a PROC in a library (i.e. PROC Library or PROCLIB) the PROCLIB must be known to the system. Most systems will search a list of predefined PROCLIBS to find a PROC. If a PROC is stored in a library that is not in the predefined list then the PROC will not be found. To specify additional PROC libraries to be searched use the JCLLIB statement. This is explained in a later section of this document.
For additional flexibility substitution parameters may be used to pass different values to a PROC. This is explained in a later section of this document.
We have made a significant effort to ensure the documents and software technologies are correct and accurate. We reserve the right to make changes without notice at any time. The function delivered in this version is based upon the enhancement requests from a specific group of users. The intent is to provide changes as the need arises and in a timeframe that is dependent upon the availability of resources.
Copyright © 1987-2025
SimoTime Technologies and Services
All Rights Reserved
This example will demonstrate the use of JCL PROCs to create three Partitioned Data Sets (PDS's). The first example will use an instream PROC and the second example will use a JCL member with a separate PROC member. The use of a substitution parameter will also be explained.
The PROC will contain the source code to create (or delete) a PDS using the DSN specified in the substitution parameter ($DSNAME) provided by the JCL member. The JCL member will contain the code to set a substitution parameter with a Data Set Name (or PDS name for this example).
The following JCL member (PDSCRTJ4.jcl) has an instream PROC. Notice the instream PROC is defined before the first step.
//PDSCRTJ4 JOB SIMOTIME,ACCOUNT,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1 //* ******************************************************************* //* This JCL Member is provided by SimoTime Technologies * //* (C) Copyright 1987-2019 All Rights Reserved * //* Web Site URL: http://www.simotime.com * //* e-mail: helpdesk@simotime.com * //* ******************************************************************* //* //* Subject: Define a PDS using the IEFBR14 with a DD Statement //* Author: SimoTime Technologies //* Date: January 1,1998 //* //* The JCL member executes the instream PROC called PDSCRTP3 and //* passes a fully qualified data set name (DSN) via the symbolic name //* called DSNAME and referenced in the PROC as &DSNAME. //* //********************************************************************* //* The instream PROC for creating a PDS. The Data Set Name (&DSNAME) //* is provided by the job step that EXECs the PROC. //* //PDSCRTP4 PROC //PDSCRTS1 EXEC PGM=IEFBR14 //TEMPLIB1 DD DISP=(NEW,CATLG),DSN=&DSNAME, // STORCLAS=MFI, // SPACE=(TRK,(45,15,50)), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PO) // PEND //* //* ******************************************************************* //* Step 1 of 3 Create a PDS using SET and EXEC //* // SET DSNAME=SIMOTIME.DEMO.TEMP01 //STEPJ41 EXEC PDSCRTP4 //* //* ******************************************************************* //* Step 2 of 3 Create a PDS using EXEC and DSNAME substitution //* //STEPJ42 EXEC PDSCRTP4,DSNAME=SIMOTIME.DEMO.TEMP02 //* //* ******************************************************************* //* Step 3 of 3 Create a PDS using EXEC and DSNAME substitution //* //STEPJ43 EXEC PDSCRTP4,DSNAME=SIMOTIME.DEMO.TEMP03 //*
In the preceding example the PROC starts with the PROC statement and ends with the PEND statement.
//PDSCRTP3 PROC . . . . . . // PEND
As stated earlier the PEND statement is required for an instream PROC but is optional for a separately defined PROC. Step 1 uses a SET statement to set a value for the DSNAME substitution parameter. Steps 2 and 3 define the DSNAME substitution parameter as part of the EXEC statement. The PROC accesses the substitution parameter by using the ampersand as a prefix or &DSNAME. In this example by using the &DSNAME substitution parameter the PROC may be used to create multiple PDS's with different names.
This example uses a single JCL member (PDSCRTJ3.jcl) and a separate PROC member (PDSCRTP3.JCL) to create three PDS's . Notice the use of the JCLLIB statement to tell the system where to find the PROC.
//PDSCRTJ3 JOB SIMOTIME,ACCOUNT,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1 //* ******************************************************************* //* This JCL Member is provided by SimoTime Technologies * //* (C) Copyright 1987-2019 All Rights Reserved * //* Web Site URL: http://www.simotime.com * //* e-mail: helpdesk@simotime.com * //* ******************************************************************* //* //* Subject: Define a PDS using the IEFBR14 with a DD Statement //* Author: SimoTime Technologies //* Date: January 1,1998 //* //* The JCLLIB tells the mainframe where to look for PROCs. //* //* The JCL member executes the PROC called PDSCRTP3 and passes a //* fully qualified data set name (DSN) via the symbolic name //* called DSNAME and referenced in the PROC as &DSNAME. //* //********************************************************************* //* //PROCLIB JCLLIB ORDER=SIMOTIME.PDS.PROCLIB //* //* ******************************************************************* //* Step 1 of 3 Create a PDS using SET and EXEC //* // SET DSNAME=SIMOTIME.DEMO.TEMP01 //S1 EXEC PDSCRTP3 //* //* ******************************************************************* //* Step 2 of 3 Create a PDS using EXEC and DSNAME substitution //* //STEP2 EXEC PDSCRTP3,DSNAME=SIMOTIME.DEMO.TEMP02 //* //* ******************************************************************* //* Step 3 of 3 Create a PDS using EXEC and DSNAME substitution //* //STEPJ003 EXEC PDSCRTP3,DSNAME=SIMOTIME.DEMO.TEMP03 //*
The following (PDSCRTP3.prc) is the PROC that will be used to create a PDS. Notice the PROC and PEND statements are not required.
//* ******************************************************************* //* PDSCRTP3.prc - a JCL Procedure Batch Job Processing * //* This JCL Procedure is provided by SimoTime Technologies * //* (C) Copyright 1987-2018 All Rights Reserved * //* Web Site URL: http://www.simotime.com * //* e-mail: helpdesk@simotime.com * //* ******************************************************************* //* //* Subject: Define a PDS using the IEFBR14 with a DD Statement //* Author: SimoTime Technologies //* Date: January 1,1998 //* //* This PROC needs the &DSNAME defined by the calling JCL member... //* // SET DSNAME=AAAA.BBBB.CCCC //* // EXEC PDSCRTP3 //* //* Also, the JCLLIB statement may be required and placed after //* the JOB card. //* //PROCLIB JCLLIB ORDER=SIMOTIME.DEMO.PROCLIB1 //* //* Technically speaking, IEFBR14 is not a utility program because it //* does nothing. The name is derived from the fact that it contains //* two assembler language instruction. The first instruction clears //* register 15 (which sets the return code to zero) and the second //* instruction is a BR 14 which performs an immediate return to the //* operating system. //* //* IEFBR14's only purpose is to help meet the requirements that a //* job must have at least one EXEC statement. The real purpose is to //* allow the disposition of the DD statement to occur. //* //* For example, the following DISP=(NEW,CATLG) will cause the //* specified DSN (i.e. PDS) to be allocated. //* Note: a PDS may also be referred to as a library. //********************************************************************* //PDSCRTP3 PROC //PDSCRTS1 EXEC PGM=IEFBR14 //TEMPLIB1 DD DISP=(NEW,CATLG),DSN=&DSNAME, // STORCLAS=MFI, // SPACE=(TRK,(45,15,50)), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PO) // PEND //*
This section provides an example of how to use a PROC to delete a PDS. Please note, if the PDS is deleted all the members in the PDS are also deleted.
The following is the JCL member (PDSDELJ3.jcl) that will use a PROC to delete the PDS's created in the Create Multiple PDS's example.
//PDSDELJ3 JOB SIMOTIME,ACCOUNT,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1 //* ******************************************************************* //* This program is provided by SimoTime Technologies * //* (C) Copyright 1987-2019 All Rights Reserved * //* Web Site URL: http://www.simotime.com * //* e-mail: helpdesk@simotime.com * //* ******************************************************************* //* //* Subject: Delete Temporary PDS's with IEFBR14 and a DD Statement //* Author: SimoTime Technologies //* Date: January 1,1998 //* //* The JCLLIB tells the mainframe where to look for PROCs. //* //* The JCL member executes the PROC called PDSDELP3 and passes a //* fully qualified data set name (DSN) via the symbolic name //* called DSNAME and referenced in the PROC as &DSNAME. //* //********************************************************************* //* //PROCLIB JCLLIB ORDER=SIMOTIME.PDS.PROCLIB //* //* ******************************************************************* //* Step 1 of 3 Delete a PDS using SET and EXEC //* // SET DSNAME=SIMOTIME.DEMO.TEMP01 //STEPJ01 EXEC PDSDELP3 //* //* ******************************************************************* //* Step 2 of 3 Delete a PDS using EXEC and DSNAME substitution //* //STEPJ02 EXEC PDSDELP3,DSNAME=SIMOTIME.DEMO.TEMP02 //* //* ******************************************************************* //* Step 3 of 3 Delete a PDS using EXEC and DSNAME substitution //* //STEPJ03 EXEC PDSDELP3,DSNAME=SIMOTIME.DEMO.TEMP03 //*
The following is the JCL PROCedure (PDSDELP3.prc) that will delete a PDS based on the value of the substitution parameter (&DSNAME) provided by the JCL member.
//* ******************************************************************* //* PDSDELP3.prc - a JCL Procedure Batch Job Processing * //* This JCL Procedure is provided by SimoTime Technologies * //* (C) Copyright 1987-2018 All Rights Reserved * //* Web Site URL: http://www.simotime.com * //* e-mail: helpdesk@simotime.com * //* ******************************************************************* //* //* Subject: Delete Temporary PDS's with IEFBR14 and a DD Statement //* Author: SimoTime Technologies //* Date: January 1,1998 //* //* This PROC needs the &DSNAME defined by the calling JCL member... //* // SET DSNAME=AAAA.BBBB.CCCC //* // EXEC PDSDELP3 //* //* Also, the JCLLIB statement may be required and placed after //* the JOB card. //* //PROCLIB JCLLIB ORDER=SIMOTIME.DEMO.PROCLIB1 //* //* Technically speaking, IEFBR14 is not a utility program because it //* does nothing. The name is derived from the fact that it contains //* two assembler language instruction. The first instruction clears //* register 15 (which sets the return code to zero) and the second //* instruction is a BR 14 which performs an immediate return to the //* operating system. //* //* IEFBR14's only purpose is to help meet the requirements that a //* job must have at least one EXEC statement. The real purpose is to //* allow the disposition of the DD statement to occur. //* //* For example, the following DISP=(OLD,DELETE) will cause the //* specified DSN (i.e. PDS) to be deleted. //* Note: a PDS is also referred to as a library. //********************************************************************* //PDSDELP3 PROC //PDSDELS1 EXEC PGM=IEFBR14 //TEMPLIB1 DD DISP=(OLD,DELETE),DSN=&DSNAME, // STORCLAS=MFI, // SPACE=(TRK,(45,15,50)), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PO) // PEND //*
This suite of JCL members and PROC's is provided as a possible approach to creating and deleting multiple, temporary PDS's. This document may be used as a tutorial for new programmers or as a quick reference for experienced programmers.
In the world of programming there are many ways to solve a problem. This documentation and software were developed and tested on systems that are configured for a SIMOTIME environment based on the hardware, operating systems, user requirements and security requirements. Therefore, adjustments may be needed to execute the jobs and programs when transferred to a system of a different architecture or configuration.
SIMOTIME Services has experience in moving or sharing data or application processing across a variety of systems. For additional information about SIMOTIME Services or Technologies please contact us using the information in the Contact or Feedback section of this document.
Software Agreement and Disclaimer
Permission to use, copy, modify and distribute this software, documentation or training material for any purpose requires a fee to be paid to SimoTime Technologies. Once the fee is received by SimoTime the latest version of the software, documentation or training material will be delivered and a license will be granted for use within an enterprise, provided the SimoTime copyright notice appear on all copies of the software. The SimoTime name or Logo may not be used in any advertising or publicity pertaining to the use of the software without the written permission of SimoTime Technologies.
SimoTime Technologies makes no warranty or representations about the suitability of the software, documentation or learning material for any purpose. It is provided "AS IS" without any expressed or implied warranty, including the implied warranties of merchantability, fitness for a particular purpose and non-infringement. SimoTime Technologies shall not be liable for any direct, indirect, special or consequential damages resulting from the loss of use, data or projects, whether in an action of contract or tort, arising out of or in connection with the use or performance of this software, documentation or training material.
This section includes links to documents with additional information that are beyond the scope and purpose of this document. The first group of documents may be available from a local system or via an internet connection, the second group of documents will require an internet connection.
Note: A SimoTime License is required for the items to be made available on a local system or server.
The following links may be to the current server or to the Internet.
Note: The latest versions of the SimoTime Documents and Program Suites are available on the Internet and may be accessed using the icon. If a user has a SimoTime Enterprise License the Documents and Program Suites may be available on a local server and accessed using the icon.
Explore the JCL Connection for more examples of JCL functionality with programming techniques and sample code.
Explore how to use Overrides with JCL and Procedures (or PROC's). The purpose of this example is to show how to use ZOS (or MVS) JCL and Procedures (or PROC's) with substitution parameters and overrides (or PROC override).
Explore how to Define and Use Variables with JCL. This suite of programs is a mainframe JCL example that will describe how to define (or name) a variable value and then use or change the variable by its referenced name.
Explore the COBOL Connection for more examples of COBOL programming techniques and sample code.
Explore An Enterprise System Model that describes and demonstrates how Applications that were running on a Mainframe System and non-relational data that was located on the Mainframe System were copied and deployed in a Microsoft Windows environment with Micro Focus Enterprise Server.
Explore The ASCII and EBCDIC Translation Tables. These tables are provided for individuals that need to better understand the bit structures and differences of the encoding formats.
Explore The File Status Return Codes that are used to interpret the results of accessing VSAM data sets and/or QSAM files.
The following links will require an internet connect.
This suite of programs and documentation is available to download for review and evaluation purposes. Other uses will require a SimoTime Software License. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.
A good place to start is The SimoTime Home Page for access to white papers, program examples and product information. This link requires an Internet Connection
Explore The Micro Focus Web Site for more information about products (including Micro Focus COBOL) and services available from Micro Focus. This link requires an Internet Connection.
Explore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papers.
This document was created and is maintained by SimoTime Technologies. If you have any questions, suggestions, comments or feedback please use the following contact information.
1. | Send an e-mail to our helpdesk. |
1.1. | helpdesk@simotime.com. |
2. | Our telephone numbers are as follows. |
2.1. | 1 415 763-9430 office-helpdesk |
2.2. | 1 415 827-7045 mobile |
We appreciate hearing from you.
SimoTime Technologies was founded in 1987 and is a privately owned company. We specialize in the creation and deployment of business applications using new or existing technologies and services. We have a team of individuals that understand the broad range of technologies being used in today's environments. Our customers include small businesses using Internet technologies to corporations using very large mainframe systems.
Quite often, to reach larger markets or provide a higher level of service to existing customers it requires the newer Internet technologies to work in a complementary manner with existing corporate mainframe systems. We specialize in preparing applications and the associated data that are currently residing on a single platform to be distributed across a variety of platforms.
Preparing the application programs will require the transfer of source members that will be compiled and deployed on the target platform. The data will need to be transferred between the systems and may need to be converted and validated at various stages within the process. SimoTime has the technology, services and experience to assist in the application and data management tasks involved with doing business in a multi-system environment.
Whether you want to use the Internet to expand into new market segments or as a delivery vehicle for existing business functions simply give us a call or check the web site at http://www.simotime.com
Return-to-Top |
JCL Procedures and PROC's, using JCL Procedures |
Copyright © 1987-2025 SimoTime Technologies and Services All Rights Reserved |
When technology complements business |
http://www.simotime.com |