EXEC with or without PGM=?

JES2/3, JCL, utilities.

Topic author
peeterjoot
New Member
Posts: 9
Joined: Fri Mar 03, 2017 2:01 am
Has thanked: 4 times
Been thanked: 1 time

EXEC with or without PGM=?

Postby peeterjoot » Wed Jun 07, 2017 8:17 am

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: 822
Joined: Wed Sep 11, 2013 3:57 pm
Been thanked: 69 times

Re: EXEC with or without PGM=?

Postby 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


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: 2392
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Has thanked: 152 times
Been thanked: 66 times

Re: EXEC with or without PGM=?

Postby 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


Thanks,
Anuj


Return to “JCL - Job Control Language.”

Who is online

Users browsing this forum: CommonCrawl [Bot] and 0 guests