Autosys and Wait

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
samit_9999
Participant
Posts: 20
Joined: Thu Oct 06, 2005 12:23 pm

Autosys and Wait

Post 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?
Kirtikumar
Participant
Posts: 437
Joined: Fri Oct 15, 2004 6:13 am
Location: Pune, India

Post 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.
Regards,
S. Kirtikumar.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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?
-craig

"You can never have too many knives" -- Logan Nine Fingers
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post 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.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
htrisakti3
Charter Member
Charter Member
Posts: 36
Joined: Thu Jun 10, 2004 11:22 pm

write date to logfile

Post 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.
Post Reply