Hi,
I am calling UtilityRun Job from a transformer, which should execute the jobs one by one. But i want to reset the job first and then run the job, can you give me a solution.
Note: I cannot reset the job mannually.
Regards,
Rajeev Prabhu
Reset job
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 136
- Joined: Wed Sep 29, 2004 5:56 am
- Location: Chennai
- Contact:
-
- Participant
- Posts: 85
- Joined: Fri Jun 04, 2004 2:30 am
- Location: Melbourne, Australia
- Contact:
After you attach to a job then you need to check the status. Here is the code you need to add.
Code: Select all
LastRunStatus = DSGetJobInfo(hJob1, DSJ.JOBSTATUS)
If LastRunStatus = DSJS.RUNFAILED Or LastRunStatus = DSJS.CRASHED Or LastRunStatus = DSJS.STOPPED Then
Call DSLogInfo(JobReportName, "Reseting job and last run status")
ErrCode = DSRunJob(hJob1, DSJ.RUNRESET)
ErrCode = DSWaitForJob(hJob1)
ErrCode = DSDetachJob(hJob1)
hJob1 = DSAttachJob(JobReportName, DSJ.ERRFATAL)
If NOT(hJob1) Then
Call DSLogFatal("Job Attach Failed: ":JobReportName, "JobControl")
Abort
End
end
Mamu Kim