EXEC with or without PGM=?

JES2/3, JCL, utilities.
Previous topicNext topic

Topic Author
Registered Member
Posts: 15
Joined: Fri Mar 03, 2017 2:01 am

EXEC with or without PGM=?

Post by peeterjoot » Wed Jun 07, 2017 8:17 am

I've seen two EXEC syntax variations, one with PGM=, like:


(with and without PARM=), and recently also saw:


This form appears to pass arguments without using PARM and also doesn't specify the PGM= part of the statement.

When would one form of this EXEC syntax be used vs the other. In the second, is everything after the command an implicit PARM value?

Global Moderator
Global Moderator
Posts: 891
Joined: Wed Sep 11, 2013 3:57 pm

Re: EXEC with or without PGM=?

Post by enrico-sorichetti » Wed Jun 07, 2017 11:47 am

the "JCL reference manual" and the "JCL user guide" will tell all You might want to know about the format of the EXEC statement

When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)

User avatar

Anuj Dhawan
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: EXEC with or without PGM=?

Post by Anuj Dhawan » Wed Jun 07, 2017 9:26 pm

A given STEP in a JCL can execute a program directly (second line from your post) or can call a procedure (fourth line from you post) - this will execute one or more programs. Statement, which supplies the job step program/procedure information is the EXEC statement.

Said that, at EXEC statement you as a programmer, can provide required information for the program/procedure being executed in that job step. Parameters coded in this statement can pass data to the program in execution (second line from your post), can override certain parameters of JOB statement and can pass parameters to the procedure if the EXEC statement calls a procedure (fourth line from your post) instead of directly executing a program.

So in short, first EXEC from your post is for a program while the second one is for PROCedure.

Please go through this IBM document, it might help you further: https://www.ibm.com/support/knowledgece ... execst.htm


Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.

Previous topicNext topic

Return to “JCL - Job Control Language.”