Defining variables with the jobprop utility

Use the jobprop utility in a job definition to set variables locally in executable jobs.

Use this utility only on executable jobs to define custom variables within the job itself. The values for the variables are defined at run time. You can then pass the values to a successive job in the same job stream.

Ensure you are logged in as TWS_user.

Syntax

jobprop  variable value

Arguments

variable
The variable name.
value
The value for the variable.

Comments

Variable names are case-sensitive. If variable names or values contain spaces, they must be included in single quotes.

Examples

On UNIX operating systems, use the jobprop utility to set the following variables in the NC125133#JOBA executable job:
  • VAR1 variable set to value1 value.
  • VAR2 variable set to value2 value.
  • VAR3 variable set to value3 value.
  • VAR4 variable set to value4 value.
NC125133#JOBA
 TASK
    ?xml version="1.0" encoding="UTF-8"?>
<jsdl:jobDefinition xmlns:jsdl="http://www.ibm.com/xmlns/prod/
scheduling/1.0/jsdl" xmlns:
jsdle="http://www.ibm.com/xmlns/prod/scheduling/1.0/jsdle">
  <jsdl:application name="executable">
    <jsdle:executable interactive="false">
    <jsdle:script>#!/bin/sh
. /home/ITAuser/TWA/TWS/tws_env.sh
jobprop VAR1 value1
jobprop VAR2 value2
jobprop VAR3 value3
jobprop VAR4 value4
</jsdle:script>
    </jsdle:executable>
  </jsdl:application>
</jsdl:jobDefinition>
 DESCRIPTION "Sample Job Definition"
 RCCONDSUCC "RC>=0"
 RECOVERY STOP
On Windows operating systems, use the jobprop utility to set the following variables in the WIN1#JOB1 executable job:
  • var1 variable set to value1 value.
  • var2 variable set to value2 value.
  • var3 variable set to value3 value.
  • var4 variable set to value4 value.
WIN1#JOB1
 TASK
    ?xml version="1.0" encoding="UTF-8"?>
<jsdl:jobDefinition xmlns:jsdl="http://www.ibm.com/xmlns/prod/
scheduling/1.0/jsdl" xmlns:
<jsdle="http://www.ibm.com/xmlns/prod/scheduling/1.0/jsdle">
  <jsdl:application name="executable">
    <jsdle:executable interactive="false">
    <jsdle:script>
call C:\Progra~1\HCL\TWA\TWS\tws_env.cmd
jobprop var1 value1
jobprop var2 value2
jobprop var3 value3
jobprop var4 value4
</jsdle:script>
    </jsdle:executable>
  </jsdl:application>
</jsdl:jobDefinition>
 DESCRIPTION "Sample Job Definition"
 RCCONDSUCC "RC>=0"
 RECOVERY STOP
Note: Before running the jobprop utility in the job definition, ensure you run the tws_env.cmd command with the correct syntax call <TWS_INST_DIR>\TWS\tws_env.cmd where <TWS_INST_DIR> is the HCL Universal Orchestrator installation directory.

For more information about how variables are passed to another job in the same job stream instance, see Passing variables set by using jobprop in one job to another in the same job stream instance.