Inserting global variables
You can add global JCL substitution variables to your JCL procedures.
Before you begin
About this task
Procedure
- To add a new global variable for a JCL procedure that is used with a COBOL program, open the COBOL Settings page of the property group editor.
- In the left pane of the window, select JCL Substitution.
- Click Insert Global Variable.
The Insert Global Variable window opens.
- Select a variable name from the table.
- Click Insert. The variable name and value are added to the table. Repeat these steps as necessary to add other global variables.
Results
When you add global variables to the JCL Substitution page
and then generate JCL or trigger a remote build or syntax check, a
SET
statement
is generated just before the EXEC PROC
statement.
The following global variables are available:- PDS
- Resolves to the partitioned data set to which the source member belongs.
- TCPIPADD
- Resolves to the workstation IP address.
- MEM
- Resolves to the source member for which a build, syntax check, or JCL generation action was requested.
- HLQ
- Resolves to the high-level qualifier of the resource for which the build, syntax check, or JCL generation action was requested.
- MSUBSTR
- Returns the member name substring that is based on starting and ending indexes that you specify.
- USERID
- Resolves to the user ID that is used to log on to the remote system.
Example
//*custom - preprocess
//SYS012 DD DSN=PDS.NAME(&MEM),DISP=SHR ---> Writes the pre-processed output to PDS.NAME(&MEM)
//...
//*compile step
//COBOL.SYSIN DD DSN=PDS.NAME(&MEM),DISP=SHR
//.....
&MEM resolves to the source member for which a build, syntax check, or JCL generation action is requested, so the user can use the JCL Substitution page to insert the global variable MEM in the properties for the MVS subproject and does not have to insert it for every member.