Page 1 of 1

Job Status Message

Posted: Wed May 11, 2011 5:44 am
by bharatmajeti
Hi,
I had ticked the check box "Add check points so that the job is restartable" in a sequencer Job properties. So the Job is able to restart from the point where it got aborted.

here we have a generic script for running datastage job. After running the datastage job, we are capturing the status and resetting the job if it is aborted.

The problem came when we have a restartable sequencer, where we need to start from the restart point, instead of starting from the beginning. so i need to differentiate the status "Aborted/Restartable", from the status "Aborted", so that i can apply reset strategy in second case.

i tried using job status, but it is giving 3 only in both the cases.

can anybody help me in differentiating above two job status messages, so that when the job is in "Aborted/Restartable" state, i will leave it as such, so that it can start from restart point. If the jobs is in "Aborted" state, i will reset it.

Thanks
Bharath.

Re: Job Status Message

Posted: Wed May 11, 2011 6:47 am
by blewip
I believe it is the Sequence that is re-startable, not the job. The job will typically get re-set anyway.

I don't think a job can abort half way through processing records and then on restart finish off the records that it hasn't processed.

On restart the job starts from the begining again.

Posted: Wed May 11, 2011 7:04 am
by bharatmajeti
Hi,
Thanks for your reply, Here i am referring to sequencer job, not the individual job. can you please tell me a way of differentiating sequencer job status as "Aborted/Restartable" (Restartable sequencer) to "Aborted"(Normal Sequencer)

Posted: Wed May 11, 2011 7:35 am
by chulett
I'm not sure how to differentiate those two just by checking the status code, you might ping your official support provider and see what they say. Worst case, I think you should be able to take an aborted Sequence and use "dsjob -jobinfo" to get the full text version of its status, then grep for "Restartable" in that output.

Posted: Wed May 11, 2011 8:14 am
by blewip
bharatmajeti wrote:Hi,
Thanks for your reply, Here i am referring to sequencer job, not the individual job. can you please tell me a way of differentiating sequencer job status as "Aborted/Restartable" (Restartable sequencer) to "Aborted"(Normal Sequencer)
If the sequences that are not Restartable are run through a master sequence that always resets, no script is required.

Posted: Thu May 12, 2011 6:13 am
by bharatmajeti
Hi Chulett,
Thanks for you info. It completed my task. I implemented it in following way.

/apps/Ascential/DataStage/DSEngine/bin/dsjob -jobinfo TTE TTE_SEQ_RPTDB >Job_Restart.txt

Job_Restart=`cat Job_Restart.txt | grep "Job Restartable" | awk -F ":" '{print $2}' | sed s'/ //g'`

if [ $Job_Restart -eq 1 ];
then echo "Job had Restart strategy implemented. exiting with out reset...so that the job will start from restart point\n"
else
echo "Job does nt have any Restart strategy implemented. resetting..." | tee -a $LOG_FILE

/apps/Ascential/DataStage/DSEngine/bin/dsjob -run -mode RESET $Project $JobName | tee -a $LOG_FILE

Posted: Thu May 12, 2011 6:24 am
by Lohit Iti
blewip wrote:
bharatmajeti wrote:Hi,
Thanks for your reply, Here i am referring to sequencer job, not the individual job. can you please tell me a way of differentiating sequencer job status as "Aborted/Restartable" (Restartable sequencer) to "Aborted"(Normal Sequencer)
If the sequences that are not Restartable are run through a master sequence that always resets, no script is required.
If u add restart option in sequence then u will get the status which u have getting , just uncheck that option and try with some other functions from that u will get the status of the job...

Posted: Thu May 12, 2011 2:07 pm
by ray.wurlod
U isn't trying to solve this; bharatmajeti is. The second person personal pronoun in English is spelled "you", not "u".