DataStage executed job return value

4 Apr

Example of how to run a job from “Job Control” in DataStage and set a status (or return value) from an executed job

      ErrCode = DSWaitForJob(hJob1)
      Status = DSGetJobInfo(hJob1, DSJ.JOBSTATUS)
      If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Or Status = DSJ.ERRFATAL Then
         * Fatal Error - No Return
         Call DSLogInfo("Job Failed!!!!: MITS_Cons_FTP", "JobControl")
         RetVal = 'Failed: Initial MITS_Cons_FTP failed'
         GO TO THEEND:

  Call DSLogInfo("At the end, retval is " : RetVal,"JobControl")
  Call DSSetUserStatus("STATUS: " : RetVal)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: