VARSUB

Purpose

This statement defines the variable substitution options. It must always be the first statement in the SCRPTLIB.

Variable substitution occurs when:
  • The Daily Planning process creates the Symphony file.
  • The job is added to the plan using the Modify Current Plan dialog.

A variable consists of up to eight alphanumeric characters. Any non-alphanumeric character, except blank, can be used as a symbol to indicate that the characters that follow represent a variable. You can define two kinds of symbols using the PREFIX or BACKPREF keywords in the VARSUB statement to define simple and compound variables.

Supplied Variables and User-defined Variables tables are supported. Refer to IBM Z Workload Scheduler Managing the Workload for details about associating variable tables with applications.

Format


1  VARSUB? + , TABLES (
2.1! GLOBAL
2.1 APPL
2.1 table1,table2,...
1 )?  PREFIX (
2.1! &
2.1 char
1 )?  BACKPREF (
2.1! %
2.1 char
1 )?  VARFAIL (
2.1! YES
2.1 NO
1 )?  TRUNCATE (
2.1! YES
2.1 NO
1 )

Parameters

TABLES(GLOBAL|APPL|table1,table2,...)
Identifies the variable tables that must be searched, and the search order. APPL indicates the application variable table (see the VARIABLE TABLE field in the MCP panel, at Occurrence level). GLOBAL indicates the table defined in the GTABLE keyword of the OPCOPTS controller and BATCHOPT batch options.
PREFIX(char|&)
A non-alphanumeric character that precedes a variable. It serves the same purpose as the ampersand (&) character used in variable substitution in z/OS® JCL.
BACKPREF(char|%)
A non-alphanumeric character that delimits a variable to form simple and compound variables. It serves the same purpose as the percent (%) character used in variable substitution in z/OS® JCL.
VARFAIL(NO|YES)
Specifies whether IBM Z Workload Scheduler is to issue an error message when a variable substitution error occurs. If you specify NO, the variable string is left unchanged without any translation.
TRUNCATE(YES|NO)
Specifies if variables are to be truncated if they are longer than the allowed length. If you specify NO and the keywords are longer than the allowed length, an error message is issued. The allowed length is the length of the keyword for which you use the variable. For example if you specify a variable of five characters for the JOBWS keyword, the variable is truncated to the first four characters.

Examples

The following example shows how to use a simple variable. When scheduling the operation, the scheduler automatically sets the simple VUSER variable to the value that is specified in the E2EVARTAB variable table that is defined in the Application Description file.
VARSUB
  TABLES(E2EVARTAB)
  PREFIX('&')
JOBREC 
  JOBCMD('dir')
  JOBUSR('&VUSER ')
In the following example of a compound variable, two substitution steps are performed automatically. The %OWSID string is processed first. OWSID is an operation-related supplied variable that is automatically set to the workstation ID for the current operation: assuming that FTW1 is the workstation ID, the first substitution step produces &FTW1SDIR.\my.cmd string. If you define the variable &FTW1SDIR in the E2EVARTAB application description table and set it to the c:\win32app\maestro value, the final result is that c:\win32app\maestro\my.cmd will be scheduled.
VARSUB
  TABLES(E2EVARTAB)
  PREFIX('&')
  BACKPREF('%') 
JOBREC
  JOBSCR('&%OWSID.SDIR.\my.cmd')
  JOBUSR('tws')

Restrictions

You can have variables that depend on other variables according to the data specified in the dependency value list. Dependent and independent variables must be defined inside the same table and a default value must be assigned to the independent variable.