Page 1 of 1

EXEC with or without PGM=?

Posted: Wed Jun 07, 2017 8:17 am
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?

Re: EXEC with or without PGM=?

Posted: Wed Jun 07, 2017 11:47 am
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

Re: EXEC with or without PGM=?

Posted: Wed Jun 07, 2017 9:26 pm
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