Hi,
Automatically we want to truncate the database for a particular date and rerun a job if the job is getting aborted.
How do we know that the job was aborted in last run?
/Josephine
How do we know the Job Running status?
Moderators: chulett, rschirm, roy
How do we know the Job Running status?
Josephine
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 232
- Joined: Fri Aug 04, 2006 1:20 am
- Location: Bangalore
You can simply use the Sequence job, and set the property as "Reset If Required, then run", So if the was aborted in the previous run, it will reset and run the job.
And if you want to get the status of the job, you can write a routine or Subroutine, something like
And proceed based on the Status.
For more information regarding the Status, See the help on DSGetJobInfo.
And if you want to get the status of the job, you can write a routine or Subroutine, something like
Code: Select all
FUNCTION GetJobStatus (JobName)
$INCLUDE DSINCLUDE JOBCONTROL.H
hJob = DSAttachJob(JobName, DSJ.ERRWARN)
Status = DSGetJobInfo(hJob, DSJ.JOBSTATUS)
ErrCode = DSDetachJob(hJob)
Ans = Status
For more information regarding the Status, See the help on DSGetJobInfo.