Page 1 of 1

Autosys and Wait

Posted: Wed Oct 04, 2006 12:06 pm
by samit_9999
I have a Autosys job which kicks off on 10th of a month.It may take a day or 2 to complete some datastage cycle. Once this is completed i have another job which should kick off after 7 days of completion of datastage cycle.
I have to setup a dependency in autosys such that if the datastage cycle completes on 11th the successor job should kick off on 18th , if the datastage cycle completes on 12th the successor job should kick off on 19th.

Please let me know if there is a way to do this?

Posted: Thu Oct 05, 2006 1:01 am
by Kirtikumar
For the first job use scheduler, may be datastage or some other like cron.
Then in the after job routine for the first job, call a shell script which will take the current date, add 7 days in it and then call cron command to schedule next execution for the job2.
Here for the second job you have to use the dsjob command or script that uses dsjob to schedule second job.

Posted: Thu Oct 05, 2006 6:50 am
by chulett
Who manages / administers your Autosys system? Have they not been able to provide you with a solution to this, other than the one you are currently using that is?

Posted: Thu Oct 05, 2006 7:07 am
by kumar_s
Or try to create a script which can be executed at end of the first job,which will actually schedule the second job after 7 days.

write date to logfile

Posted: Sun Oct 08, 2006 12:22 pm
by htrisakti3
I'd approach it as follows:

1. DSjob10 (that runs on 10th of month) - writes 1 line of completed date in the text logfile.

2. DSCheck7d - checks if it's been 7d since the last completion.
This job (Job Control in Basic) - read the above file created in step1, check if system date is >= (date in step1 + 7), if not exit straight away.

This way, you can avoid maintaining complicated Autosys jobs
You can have only 1 daily autosys that kicks off DSCheck7d.