Using variables in IBM® Workload Scheduler jobs

This section explains how to add variables to jobs you plan to run with IBM® Workload Scheduler.

When importing jobs from IBM Workload Scheduler, you can add variables to obtain higher flexibility for your job.

The variables are assigned a value when you submit the job in IBM Workload Scheduler. The supported IBM Workload Scheduler variables are as follows:
Table 1. Supported IBM Workload Scheduler variables in JSDL definitions.
Variables that can be inserted in the IBM® Workload Scheduler job definition Description
tws.host.workstation Name of the host workstation
tws.job.date Date of the submitted job.
tws.job.fqname Fully qualified name of the job (UNISON_JOB)
tws.job.ia Input arrival time of the job
tws.job.interactive Job is interactive. Values can be true or false. Applies only to backward-compatible jobs.
tws.job.logon Credentials of the user who runs the job (LOGIN). Applies only to backward-compatible jobs.
tws.job.name Name of the submitted job
tws.job.num UNISON_JOBNUM
tws.job.priority Priority of the submitted job
tws.job.promoted Job is promoted. Values can be YES or No. For more information about promotion for dynamic jobs, see the section about promoting jobs scheduled on dynamic pools in IBM Workload Scheduler: User's Guide and Reference.
tws.job.recnum Record number of the job.
tws.job.resourcesForPromoted Quantity of the required logical resources assigned on a dynamic pool to a promoted job. Values can be 1 if the job is promoted or 10 if the job is not promoted. For more information about promotion for dynamic jobs, see the section about promoting jobs scheduled on dynamic pools in IBM Workload Scheduler: User's Guide and Reference.
tws.job.taskstring Task string of the submitted job. Applies only to backward-compatible jobs.
tws.job.workstation Name of the workstation on which the job is defined
tws.jobstream.id ID of the job stream that includes the job (UNISON_SCHED_ID)
tws.jobstream.name Name of the job stream that includes the job (UNISON_SCHED)
tws.jobstream.workstation Name of the workstation on which the job stream that includes the job is defined
tws.master.workstation Name of the master domain manager (UNISON_MASTER)
tws.plan.date Start date of the production plan (UNISON_SCHED_DATE)
tws.plan.date.epoch Start date of the production plan, in epoch format (UNISON_SCHED_EPOCH)
tws.plan.runnumber Run number of the production plan (UNISON_RUN)
The following example illustrates a JSDL file with several of the supported IBM Workload Scheduler variables defined:
…<jsdl:jobDefinition xmlns:jsdl="http://www.abc.com/xmlns/prod/scheduling/1.0/jsdl" xmlns:jsdle="http://www.abc.com/xmlns/prod/scheduling/1.0/jsdle" description="This jobs prints UNISON Variables received from TWS in standard OutPut " name="sampleUNISON_Variables">
  <jsdl:annotation>This jobs prints UNISON Variables received from TWS in standard OutPut </jsdl:annotation>
  <jsdl:variables>
    <jsdl:stringVariable name="tws.jobstream.name">none</jsdl:stringVariable>
    <jsdl:stringVariable name="tws.job.fqname">none</jsdl:stringVariable>
    <jsdl:stringVariable name="tws.master.workstation">none</jsdl:stringVariable>
    <jsdl:stringVariable name="tws.plan.runnumber">none</jsdl:stringVariable>
    <jsdl:stringVariable name="tws.plan.date">none</jsdl:stringVariable>
    <jsdl:stringVariable name="tws.plan.date.epoch">none</jsdl:stringVariable>
    <jsdl:stringVariable name="tws.job.logon">none</jsdl:stringVariable>
  </jsdl:variables>
  <jsdl:application name="executable">
    <jsdle:executable output="${tws.plan.runnumber}">
      <jsdle:environment>
        <jsdle:variable name="UNISON_SCHED">${tws.jobstream.name}</jsdle:variable>
        <jsdle:variable name="UNISON_JOB">${tws.job.fqname}</jsdle:variable>
        <jsdle:variable name="UNISON_MASTER">${tws.master.workstation}</jsdle:variable>
        <jsdle:variable name="UNISON_RUN">${tws.plan.runnumber}</jsdle:variable>
        <jsdle:variable name="UNISON_SCHED_DATE">${tws.plan.date}</jsdle:variable>
        <jsdle:variable name="UNISON_SCHED_EPOCH">${tws.plan.date.epoch}</jsdle:variable>
        <jsdle:variable name="LOGIN">${tws.job.logon}</jsdle:variable>
      </jsdle:environment>
…