IBM Support

How to use command in variable of TWS

How To


Summary

Sometimes user want to dynamic parameter in TWS job definition, for example, in TWS job, user want to pass the current date as parameter to execute a script:

WORKSTATION_A#JOB_A
SCRIPTNAME "/home/datacentre/test_script.sh currentdate
STREAMLOGON opr1
DESCRIPTION "Testing"
TASKTYPE UNIX
RECOVERY STOP

How can user do this in TWS?

Environment

UNIX/LINUX

Steps

In TWS, user can use variable to pass dynamic parameter, and when the job get submitted, the variable will get resolved at run time, for example, if user want to pass current date as parameter for a script, can use following steps:
1) In TWS, define the following variable CURRENTDATE:

VARTABLE MAIN_TABLE

ISDEFAULT

MEMBERS

CURRENTDATE "date +%m/%d/%y"

END

2) In Job definition, use following DOCOMMAND to resolve the variable defined in above step:

DOCOMMAND "<directory>/test.sh `^CURRENTDATE^`"

3) Variable CURRENTDATE will get resolved at job run time.

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB45","label":"Automation"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSFMUJ","label":"Tivoli Workload Scheduler"},"ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]

Document Information

Modified date:
24 October 2021

UID

ibm16508479