Mainframe Open Education Project
  • Welcome: Learn & Contribute to MOE
    • MOE Vision, Mission and Content Phases
    • Who Can Contribute?
    • Contributor Log In
    • Earn A Contributor Badge
    • MOE Management System
    • MOE Events
    • Project Support
    • Legal Disclaimer, Copyright and License
    • Code of Conduct
    • Project Governance
    • Why MOE
  • Introduction: What is Enterprise Computing?
  • Chapter 1: What is a Mainframe Today?
    • Role of the Mainframe Today
      • Mainframe and the Cloud
      • Enterprise Computing
      • Hybrid Cloud
    • Who Uses the Mainframe and Why
    • Mainframe versus Server
    • Mainframe Basic Architecture & Components
    • How the Mainframe Works
    • Mainframe Security Myths
    • Mainframe Evolution
    • Mainframe Modernization
    • Video: ITs Best Kept Secret
    • Get Ready: Talk Like a Mainframer
    • Looking Back: The First 50 Years of Mainframe
  • Chapter 2: Foundational Technology
    • Brief Introduction to z/OS
    • TSO/E, ISPF, and UNIX System Services (USS): Interactive facilities of z/OS
    • Data Sets and How They Work
    • Job Control Language and System Display and Search Facility
      • Understanding the JCL(Job Control Language)
        • Understanding the JOB Statement
        • Understanding the EXEC Statement
        • Understanding the DD Statement
        • Creating a Physical Sequential (PS)
        • Understanding Libraries in JCL
        • Understanding Instream Procedures, Cataloged Procedures, and Symbolic Parameters in JCL
      • Utilities
        • IEBCOMPR
        • IEBGENER
          • Copying Between Sequential Datasets and PDS Members Using IEBGENER
          • Generate PDS member while copying
          • Copying a UNIX File to a PS File
        • IEBCOPY
          • IEBCOPY selective copy using select statements
          • IEBCOPY Exclude members while copying
          • IEBCOPY renaming member while copying
      • GDG
        • GDG parameters
        • GDG base
        • GDG Generation
          • Referencing GDG Generations Using Relative Numbers
        • Alter and Delete GDG
    • Enterprise Software Development and Implementation
    • Programming languages for Mainframe
    • Modern Application Management
    • Video: System Overview
    • Video: MVS Using Dynamic Allocations
    • Article: Red Hat OpenShift 4.7 on IBM Z Is a Game Changer for Container Orchestration and Managemen
    • IBM z16
  • Chapter 3: Roles in Mainframe
    • Roles and Categories
      • Category Definitions
  • Chapter 4: Deeper Dive in Role Chosen
    • IT Operations and System Support and Services
    • IT Business/Software Product Application Development and Support
    • IT Software Engineers
    • IT Architects
  • Chapter 5: Career Path Opportunities
    • Learning Programs
    • Job Opportunities
    • Career Event Calendar
    • Open to Hire
  • Mainframe Events and Conferences 2024
  • My Mainframe Journey: From Student to Professional
  • Backlog on Topics
  • Additional Community Resources
    • Communities
    • Courses, Tutorials, Manuals
    • Education Programs
    • IBM Mainframe Timeshare Services
  • Digital Certificate Badges
    • z/OS Mainframe Practitioner
  • Reviewer List
  • Modern Mainframe
    • What is a modern mainframe environment?
    • z/OSMF
      • What is z/OSMF?
      • Why it is important in a mainframe shop
      • z/OSMF Learning Materials
    • Zowe
Powered by GitBook
On this page

Was this helpful?

  1. Chapter 2: Foundational Technology
  2. Job Control Language and System Display and Search Facility
  3. Understanding the JCL(Job Control Language)

Understanding Instream Procedures, Cataloged Procedures, and Symbolic Parameters in JCL

What Are Instream Procedures?

  • An in-stream procedure is written directly within the same JCL member where it is executed. It starts with a PROC statement and ends with a PEND statement. These procedures consist only of a limited set of JCL statements.

  • An in-stream procedure may include: CNTL,COMMENT,DD,END CNTL,EXEC,IF/THEN/ELSE/ENDIF,INCLUDE,SET

  • Written directly in the JCL between the PROC and PEND statements.

  • Must be defined before the step that executes the procedure.

  • Limited to the job in which it is defined

Example

//MYJOB JOB (12345),CLASS=A,MSGCLASS=X

//MYPROC PROC

//STEP1 EXEC PGM=IEFBR14

//STEP2 EXEC PGM=PROGRAM2

//PEND

//STEP3 EXEC PROC=MYPROC

Explanation

  • MYPROC - PROC: The instream procedure defined in the same JCL file.

  • PEND: Marks the end of the procedure.

  • EXEC PROC=MYPROC: Invokes the procedure in Step 3.

What Are Cataloged Procedures?

When the procedure is separated out from the JCL and coded in a different data set, it is called a Cataloged Procedure. A PROC statement is not mandatory to be coded in a cataloged procedure

Example

Suppose MYPROC is a cataloged procedure stored in a library. The JCL to invoke it is:

//MYJOB JOB (12345),CLASS=A,MSGCLASS=X

//JCLLIB ORDER=MY.PROC.LIB

//STEP1 EXEC PROC=MYPROC

Procedure Definition (Stored in MY.PROC.LIB)

//MYPROC PROC

//STEP1 EXEC PGM=IEFBR14

//STEP2 EXEC PGM=PROGRAM2

Explanation

  • JCLLIB ORDER=MY.PROC.LIB: Points to the library where the cataloged procedure is stored.

  • EXEC PROC=MYPROC: Executes the predefined steps in the cataloged procedure MYPROC

What Are Symbolic Parameters?

  • Symbolic parameters allow us to pass information from JCL to procedures (PROCs), making PROCs reusable with different values when calling from different JCLs.

  • They allow us to pass variable information from JCLs to procedures (PROCs) without changing the actual procedures (PROCs) code. This makes it easier to manage jobs and procedures that need to run with different parameters in different situations.

  • Symbolic parameters are placeholders or variables used in PROCs. They receive variable data from JCL, which replaces symbolic variables in PROC. Symbolic parameters can be defined and used in the same JCL.

This procedure is stored in a library (e.g., MY.PROC.LIB) and uses symbolic parameters for flexibility.

//COPYPROC PROC FILENAME=DEFAULT.DATA

//STEP1 EXEC PGM=IEBGENER

//SYSPRINT DD SYSOUT=*

//SYSUT1 DD DSN=&FILENAME,DISP=SHR

//SYSUT2 DD DSN=OUTPUT.FILE,DISP=(NEW,CATLG,DELETE),

// SPACE=(TRK,(5,5)),UNIT=SYSDA

JCL Invoking the Procedure

This job invokes the procedure COPYPROC and passes a specific value for the symbolic parameter FILENAME.

//MYJOB JOB (123),CLASS=A,MSGCLASS=X

//JCLLIB ORDER=MY.PROC.LIB

//STEP1 EXEC PROC=COPYPROC,FILENAME=MY.INPUT.DATA

Explanation

  1. In the Procedure:

    • &FILENAME is a symbolic parameter with the default value DEFAULT.DATA.

  2. In the Job:

    • When invoking COPYPROC, the value MY.INPUT.DATA is passed for &FILENAME.

    • This replaces the placeholder &FILENAME in the procedure.

  3. Final Output: During execution, the following statements are generated:

//SYSUT1 DD DSN=MY.INPUT.DATA,DISP=SHR

//SYSUT2 DD DSN=OUTPUT.FILE,DISP=(NEW,CATLG,DELETE),

// SPACE=(TRK,(5,5)),UNIT=SYSDA

PreviousUnderstanding Libraries in JCLNextUtilities

Last updated 5 months ago

Was this helpful?