Using variables in template steps
You can add customization capabilities to template steps through the use of step-specific variables and other techniques for designing steps, as described in this topic.
- Specify certain variables as being able to be used in a JOB statement.
- Use the same JCL repeatedly over a number of steps, but with a different set of values substituted for each job submission.
Variable substitution in the JOB statement
As the workflow author, you might want to indicate that certain variables in the workflow can be
used in a JOB statement. To make a variable available for user selection, include the exposeToUser
(<exposeToUser>) element on the variable element tag. This element indicates
that the variable is to be included among the user-selectable variables in the List
variables for substitution window of the Workflows task.
With the exposeToUser element, you can identify a certain set of variables that can be used (through substitution) in the JOB statement when the step owner is performing the step. To use a variable, the step owner would have to modify the JOB statement to add the variable reference. The step owner can then view the substitution to see whether the JOB statement is as desired. The step owner can optionally designate the edited JOB statement be used for all steps in the workflow instance, but must understand the impact of doing so.
Suppose, for example, that you want to allow the user to select a notification user ID for the job. The system will send a message to this user ID when the job completes.
FRED that is intended to be used with the NOTIFY= keyword parameter in the JOB
statement. On the variable definition, include the exposeToUser
element:<variable name="notify-user">
<label>Notify user ID</label>
<abstract>This user ID can be selected for job notifications</abstract>
<description>Simple string variable.</description>
<exposeToUser>
<usage>Use this variable with the NOTIFY= parameter of the JOB statement
so that its value will designate who is notified when the job completes.</usage>
</exposeToUser>
<category>exposeToUser variables</category>
<string>
<default>FRED</default>
</string>
</variable>
//IZUWFJB JOB (ACCTINFO),CLASS=A,MSGCLASS=0,
MSGLEVEL=(1,1),REGION=0M,NOTIFY=IBMUSEROn the Create JOB statement page is the option List variables for substitution. If the user clicks this option, the Workflows task displays the variables in the workflow that include the exposeToUser element. The user can make JOB statement substitutions by manually copying these variables into the JOB statement.
notify-user variable would be displayed in the
List variables for substitution window. To use the
notify-user variable for the notification user ID, the user can copy it into the
JOB statement, as follows:
//IZUWFJB JOB (ACCTINFO),CLASS=A,MSGCLASS=0,
MSGLEVEL=(1,1),REGION=0M,NOTIFY=${instance-notify-user}FRED:
//IZUWFJB JOB (ACCTINFO),CLASS=A,MSGCLASS=0,
MSGLEVEL=(1,1),REGION=0M,NOTIFY=FREDPredefined variables in a step
Suppose that your workflow contains a number of steps that run the same job repeatedly, except for some values in the body of the job that must change each time that the job is submitted. As an alternative to maintaining a slightly different copy of the JCL for each step, you can use the same job and call it from multiple steps. This technique requires that each step supply its own substitution values or predefined variables for each job submission. Doing so allows you as the workflow author to adjust the contents of the job dynamically to suit each step, based on the predefined variables.
<predefinedVariable>) element on the step element tag, with the following
element attribute: - name=
- Name of the variable (a string).
A predefined variable is treated as a string substitution for the current step only. You can specify multiple predefined variables per step. To avoid overriding the variables that are defined for the workflow, use a unique name for the predefined variable.