superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Interesting. Two posts on the exact same subject in the same week:
www.ibmmainframes.com/viewtopic.php?t=9435&highlight=
Now, I don't know the answer, but one would think that it's probably easy to find with a simple Internet search, such as the following:
www.users.bigpond.com/robin_v/plistuff.htm
which contains this text:
Quote: |
Parameter Passing to a Program Using JCL
JCL Parameters (PARM=) are a good way to pass control information to programs. Use them for simply overriding control, not as a replacement for a series of control cards. Also avoid the switch string of ones and zeros. Leave that to the Assembler programmers.
Some examples are for if the program is running in test or production, having a purge-all feature in a housekeeping program, or to turn on tracing. Think about having the default be the absence of a parameter. Also use the INDEX function to search for control strings to avoid positional errors.
//AQUA01E JOB
//*-------------------------------------------------------------------*
//* STEP01 - EXECUTE PROGRAM KK3100 FOR TEST DATA ONLY *
//*-------------------------------------------------------------------*
//STEP01 EXEC PGM=KK31001,REGION=4096K,PARM='/DEBUG'
read DEBUG into the program from the PARM= above
PASSIT: PROC(PARMIN) OPTIONS(MAIN);
DCL PARMIN CHAR(100) VARYING;
PARMIN will have the string '/DEBUG?'. I = INDEX(PARMIN,'DEBUG'); tells there is a DEBUG and the location.
A parameter passed to the program is the classic example of a variable-length character string. In other words, it is a variable where the length is not known until execution time. The idea of testing parameter variables by looking for the string instead of at a specific location has a couple of advantages:
You can have free-form input for more than one value.
After all, no one remembers what the program needs when enhancing the production JCL.
|
and/or that it would be documented in the programmer's guide manuals. |
|