How to configure program locations to use Cobol - CALL ?

Posted on 2011-05-09
Last Modified: 2012-08-14
Hi Experts

Some days ago I've asked about compilation and linkedition of mainframe cobol code.
I have a doubt about the CALL command, since it could call programs inside other locations

My doubt is : could a program call another program at other libraries ?
If so, how to configure it ?

According to:
Library :   built around the concept of a three tier  layout to a dataset / file name
project - The catalogue High level prefix under which the dataset is stored.
group - The basic name identifier of the dataset
type - a third level indicating the type of data being stored
Member - for a PDS(e) Partitioned Dataset the name of the element actually containing the Data...
Question by:Eduardo Fuerte
    LVL 7

    Expert Comment

    There are two types of CALL implementations in COBOL: a dynamic call and a static call.  In a dynamic call, the called routine is located at runtime.  In general, this is done via the linklist, JOBLIB, or STEPLIB.  For a static call, the called routine is located at binder (or linkedit) time and the called module is located via a SYSLIB or INCUDE card specifying another library.

    You can find details on both of these situations in the COBOLProgramming Guide ( in chapter 4.1
    LVL 57

    Expert Comment

    garypfirstech is correct.  

    If you are familure with how distributed systems work you can think of linklst, JOBLIB, STEPLIB, as the PATH varible, or in Java as the CLASSPATH variable.

    Author Comment

    by:Eduardo Fuerte

    But in therms of

    Library/ project/ group / type Member -
    for a PDS(e) Partitioned Dataset the name of the element actually containing the Data

    How must be this cards configurated - using the directives you've pointed ?
    (since I'm in the correct way)
    LVL 57

    Accepted Solution

    project/group/type are used to make up a dataset name (a.k.a a file name) like:


    A member is within one fo these files.  You can't point to a member, you point to the dataset.

    In JCL you can either code a JOBLIB or a STEPLIB and it would look something like:




    Then whenever you CALL a program the system will look for that program in the file PAYROLL.ACCT.PROD.LOADLIB.

    You can't control LINKLST, this is control by the system programmers and no offense, but I hope your not one of tye sysprogs.
    LVL 7

    Assisted Solution

    giltjr has provided the information for a dynamic call.  The name supplied in your COBOL program is used as the name of a member or alias in the PDSes or PDSEs associated with your JOBLIB or STEPLIB DD statements.  The order of searching for dynamically called programs is explained in more detail in section 2.6.1 of the JCL user's guide. (

    For information on specifying the dataset for a static call, please see the Program Management User's Guide and reference ( section 4.2 and the INCLUDE statement discussion.

    Author Closing Comment

    by:Eduardo Fuerte
    Now it's up to me to deep the knowledge.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now