EXEC with or without PGM=?

JES2/3, JCL, utilities.
Post Reply
peeterjoot
Registered Member
Posts: 15
Joined: Fri Mar 03, 2017 2:01 am
Contact:

EXEC with or without PGM=?

Post by peeterjoot »

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

//PLUPDAT EXEC PGM=KUPDATE

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

//ALLOC0 EXEC ALCPS,LLQ=SYSOUT.ACT,RF=FBA,RL=121

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?
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 826
Joined: Wed Sep 11, 2013 3:57 pm

Re: EXEC with or without PGM=?

Post by enrico-sorichetti »

the "JCL reference manual" and the "JCL user guide" will tell all You might want to know about the format of the EXEC statement
cheers
enrico
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
Founder
Posts: 2801
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: EXEC with or without PGM=?

Post by Anuj Dhawan »

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
Thanks,
Anuj

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.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “JCL - Job Control Language.”