Page 1 of 1

help in dsjob command

Posted: Tue Sep 20, 2011 11:27 pm
by pandeesh
I am creating a unix for triggering multiple instances of a job.

I am using -jobstatus in dsjob command.
It causes the second instance to wait until the first instance finish.

Once the first instance finishes, the second instance starts.

But i want to run both the instances and want the job status of both jobs once they finished,.

Becuase if any of the instances abort, i need to trigger the mail.

Please help me to achieve this.

Thanks

Re: help in dsjob command

Posted: Tue Sep 20, 2011 11:32 pm
by samyamkrishna
why dont you build a sequence for it.
it will be easier

Posted: Tue Sep 20, 2011 11:37 pm
by pandeesh
Just i want to try it in unix script.

Posted: Wed Sep 21, 2011 12:58 am
by SURA
Did you pass the jobname.invocation id ?

Posted: Wed Sep 21, 2011 1:45 am
by arvind_ds
Sura has given a good idea !!!

Posted: Wed Sep 21, 2011 3:04 am
by ray.wurlod
Are you really going to "create a unix" just for that? Or just create a UNIX shell script?
:lol:

You need to run dsjob with neither -wait nor -jobstatus (which you could have determined by searching DSXchange); your script must then periodically check the status of each job until the status of both is no longer "running", then react appropriately according to what those status values are.

Posted: Wed Sep 21, 2011 4:31 am
by pandeesh
Yes Ray! I have created a unix shell script for my requirement.

I havent used -wait as well as -jobstatus.

I am checking manually and resetting the job if required.

Thanks

Posted: Wed Sep 21, 2011 6:31 am
by chulett
So rather than checking manually, build a -jobstatus check loop into your script where you parse out the result. When both have completed, based on what happened, either exit gracefully or send out your alert email(s).

Posted: Wed Sep 21, 2011 6:36 am
by pandeesh
But however there might be some time delay.
Since i am not sure how long the job will take to finish, i am checking in the loop for every 100 secs and once it's finished sending the mail

Thanks

Posted: Wed Sep 21, 2011 6:39 am
by chulett
Of course. So, resolved?