Job Status Macros

Use macros that are provided in the JOBCONTROL.H file to obtain information about the current job, and links and stages belonging to the current job.

The macros that are provided in the JOBCONTROL.H file provide the functionality of using the InfoSphere® DataStage® BASIC DSGetProjectInfo, DSGetJobInfo, DSGetStageInfo, and DSGetLinkInfo functions with the DSJ.ME token as the JobHandle and can be used in all active stages and before/after subroutines. The macros provide the functionality for all the possible InfoType arguments for the DSGet...Info functions.

The available macros are:

  • DSHostName
  • DSProjectName
  • DSJobStatus
  • DSJobName
  • DSJobController
  • DSJobStartDate
  • DSJobStartTime
  • DSJobWaveNo
  • DSJobInvocations
  • DSJobInvocationId
  • DSStageName
  • DSStageLastErr
  • DSStageType
  • DSStageInRowNum
  • DSStageVarList
  • DSLinkRowCount
  • DSLinkLastErr
  • DSLinkName

For example, to obtain the name of the current job:


MyName = DSJobName

To obtain the full current stage name:


MyName = DSJobName : "." : DSStageName

In addition, the following macros are provided to manipulate Transformer stage variables:

  • DSGetVar(VarName) returns the current value of the named stage variable. If the current stage does not have a stage variable called VarName, then "" is returned and an error message is logged. If the named stage variable is defined but has not been initialized, the "" is returned and an error message is logged.
  • DSSetVar(VarName, VarValue) sets the value of the named stage variable. If the current stage does not have a stage variable called VarName, then an error message is logged.