I just had a discussion, where a z/VSE user wanted to use parameters set with z/VSE Job Control statements in batch programs (called by EXEC <program name>).
In this blog I describe two ways of passing parameters from Job Control to programs - via 1) EXEC <program name>,PARM='value', 2) SETPARM pname='value'.
- EXEC <program name>, PARM='value'
Specifies information which is to be passed to the program at execution. value can be up to 100 characters in length, enclosed in quotes. If the value is longer than 100 characters, you can code PARM='value' up to three times on one EXEC statement (that is max. 300 bytes). The information given by value is stored into the system GETVIS area. The value and the value length is passed to the program. For more information see the z/VSE Guide to System Function (section "Passing a Parameter").
- SETPARM pname='value' (set symbolic parameter)
The SETPARM statement enables you to define a symbolic parameter and/or assign a value to it, where pname is the name of the symbolic parameter, which a value is to be assigned. value specifies a character string of up to 50 characters. In a program or Job Control exit you may retrieve the value with the GETSYMB macro. The macro is described in z/VSE Guide to System Function (section "Resolving Symbolic Parameters in JCL Command").
Both the z/VSE System Control Statements and z/VSE Guide to System Functions books can be downloaded from the z/VSE documentation page - here.
Have a good weekend.