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?

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

Understanding Libraries in JCL

Understanding Libraries in JCL

In JCL, libraries refer to storage locations where datasets, programs, or procedures are stored. They are critical in mainframe environments, as they allow organized access to frequently used resources like executable programs, reusable procedures, or dataset definitions. Libraries ensure efficiency, reusability, and proper organization of system resources.

To successfully run the program that you specify on a JCL, EXEC statement z/OS has to search for and find that program. Using JOBLIB or STEPLIB statements can reduce search time.

When you code the PGM parameter, z/OS looks for a program, and will automatically search standard system program libraries, such as SYS1.LINKLIB, which contains IBM-supplied programs.

If the program you want to run resides in a private program library, you must specify either a JOBLIB statement or a STEPLIB statement for z/OS to successfully locate the program.

JOBLIB (Program Library for All Steps in a Job)

  • Specifies the library where the system should search for programs used in all steps of the job.

  • JOBLIB applies to every step in the job. This is useful when multiple steps use programs stored in the same library

Example

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

//JOBLIB DD DSN=MY.LOAD.LIB,DISP=SHR

//STEP1 EXEC PGM=PROGRAM1

//STEP2 EXEC PGM=PROGRAM2

  • Explanation:

    • JOBLIB: Directs the system to MY.LOAD.LIB to locate the programs PROGRAM1 and PROGRAM2 for both steps.

STEPLIB (Program Library for a Specific Step)

  • Specifies the library to search for programs for a single step within a job.

  • Overrides JOBLIB and applies only to the step where it is defined.

Example:

//STEP1 EXEC PGM=PROGRAM1

//STEPLIB DD DSN=MY.LOAD.LIB,DISP=SHR

Explanation:

  • STEPLIB: Directs the system to search for PROGRAM1 in MY.LOAD.LIB.

JCLLIB (Procedure Library for Cataloged Procedures)

  • The JCLLIB statement specifies the location of cataloged procedures.

  • If the cataloged procedure resides in a specific dataset library, the JCLLIB statement ensures that the system searches that location to find the procedure.

Example:

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

//JCLLIB ORDER=MY.PROC.LIB

//STEP1 EXEC PROC=MYPROC

Explanation:

  • JCLLIB ORDER=MY.PROC.LIB: Tells the system to look in MY.PROC.LIB for the cataloged procedure MYPROC.

PreviousCreating a Physical Sequential (PS)NextUnderstanding Instream Procedures, Cataloged Procedures, and Symbolic Parameters in JCL

Last updated 5 months ago

Was this helpful?