Page 1 of 1

Restart variable in Sequence

Posted: Wed Dec 03, 2008 3:50 pm
by poorna_76
Hi All,
Is there any DataStage Macro/variable that can be used inside the Sequence, to determine if that particular run is normal run or a restart.


Thanks in Advance.

Posted: Wed Dec 03, 2008 5:21 pm
by ray.wurlod
No.

You could look at the job sequence log in Director (or using API functions or dsjob command) - from memory a regular run request has "job run requested" while a reset has something different.

Posted: Thu Dec 04, 2008 8:14 am
by poorna_76
ray.wurlod wrote:No.

You could look at the job sequence log in Director (or using API functions or dsjob command) - from memory a regular run request has "job run requested" while a reset has something different. ...
Thanks Ray.

What i am trying to accomplish here is, if the Sequence is executed from a previous abort(if i can determine if it is a Restart, from within the Sequence), i would like to execute a job which deletes the data from a table that got partially loaded.

If i can not determine if it is a Restart, from within the Sequence, is there a 'Before' stage command in OracleEnterprise stage to do the cleanup for the partial loaded table, in case of a restart?
I would like to cleanup the data that is already partially loaded into that table and rerun the same job.

Thanks in Advance.

Posted: Thu Dec 04, 2008 1:50 pm
by ray.wurlod
I can still only suggest creating a server routine (and invoke it from a Routine activity) to read the job sequence's log.

Posted: Thu Dec 04, 2008 11:28 pm
by infranik
Try to implement some logic as such
At the start of the sequencer, create an empty file. delete this file on successful completion of the sequencer. can use after-jopb subroutine.
When starting the sequencer, try to see if file is present. If its present it means the seq is restarted after abort - call your delete jobs and clean the table. conversely if the file is not present, then it means your sequencer has run properly.