How do we know the Job Running status?

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Josephine
Participant
Posts: 37
Joined: Mon Jun 16, 2008 2:32 am

How do we know the Job Running status?

Post by Josephine »

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
Josephine
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What database do you wish to truncate? You can determine a job's status from the previous run at any time prior to submitting the current run request.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Josephine
Participant
Posts: 37
Joined: Mon Jun 16, 2008 2:32 am

Post by Josephine »

ray.wurlod wrote:What database do you wish to truncate? You can determine a job's status from the previous run at any time prior to submitting the current run request. ...
Thanks for your reply
Oracel 9.0 is our Database
Could you tell me how to determine the job's status?
Josephine
DS_SUPPORT
Premium Member
Premium Member
Posts: 232
Joined: Fri Aug 04, 2006 1:20 am
Location: Bangalore

Post by DS_SUPPORT »

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

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
And proceed based on the Status.
For more information regarding the Status, See the help on DSGetJobInfo.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So, since you can't "truncate for a particular date", how are you going to handle deleting the previously loaded data? Perhaps a Transaction Size of zero is on order so you get an "all or nothing" load?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply