IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Trigger jobs but have to run within a specified time


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
peterwu

New User


Joined: 21 Jun 2009
Posts: 3
Location: Toronto

PostPosted: Sun Jun 21, 2009 9:28 am
Reply with quote

Hi,

I have the following jobs flow and scheduled in CA7:
X -> A -> B -> C -> D ... up to J.

But jobs A, B, C ..... J should only run within a specified time in any day, say between 17:00 - 20:00 hours.

For example if the job is triggered before 17:00 then it should wait until 17:00 to run or if the job is triggered after 20:00 then it should wait until tomorrow 17:00 to run.

Please advise how to achieve this in CA7. Thanks.
Back to top
View user's profile Send private message
maheshvamsi

New User


Joined: 22 Mar 2008
Posts: 39
Location: bangalore

PostPosted: Mon Jun 22, 2009 7:39 am
Reply with quote

1. How the job X will be triggered?

2. What happens if the job X triggers between 17.00 to 20.00??

If you want the jobs A,B,C need to be triggered at only 17.00 after the jobs X triggers, you can use SASTRLR. By using SASTRLR step in Job X, you can demand it at 17.00 PM, using below command.

DEMAND,JOB=JOBNAME, TIME=1700.

This will demand Job A to run at 17.00. As you are already having triggers it will run rest of the stream.

If Job X, triggers before 1700, Job A will start running at 17.00

If Job X, triggers after 1700, Job A will start running on Nextday 17.00.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Jun 22, 2009 8:53 am
Reply with quote

Hi maheshvamsi,

DEMAND will server purpose to run suite once.. It wont automate process..
Back to top
View user's profile Send private message
maheshvamsi

New User


Joined: 22 Mar 2008
Posts: 39
Location: bangalore

PostPosted: Mon Jun 22, 2009 12:12 pm
Reply with quote

As per my understading, Job X will run at any time, But A job should run 5 PM, after X runs.

At that time you should use demand with time option.

If you simply use Demand, Job A will run as soon as X completes.
Back to top
View user's profile Send private message
peterwu

New User


Joined: 21 Jun 2009
Posts: 3
Location: Toronto

PostPosted: Mon Jun 22, 2009 6:02 pm
Reply with quote

Yes, job X will run at any time. Demanding and using the time option is good but not perfect in my case.

If X completed at 18:00, Job A needs to wait for the next day 17:00 to run but actually it is allow to run at between 17:00 and 20:00. Therefore the drawback is once X completed after 17:00 all the rest of jobs need to wait for the next day even X completed before 20:00.

I have to write a small program to check the time Job X completed and base on the completion time to flag a condition code on the step, then using SASSTRLR to either demand with time option or without time option depending on the return code of the program.

One thing I am not sure is the TIME=1700 option will automatic wait for the next day 17:00 to run if it is demand after 17:00 but before 23:59, or we need to use the DATE=+01 to specify the next day. Any confirmation about time option for the "NEXTDAY" issue?
Back to top
View user's profile Send private message
maheshvamsi

New User


Joined: 22 Mar 2008
Posts: 39
Location: bangalore

PostPosted: Mon Jun 22, 2009 6:43 pm
Reply with quote

Quote:
I have to write a small program to check the time Job X completed and base on the completion time to flag a condition code on the step, then using SASSTRLR to either demand with time option or without time option depending on the return code of the program.


I think no need to write a program for checking a flag or time.

Just you can use demand with Time option.

If job X completes before 1700, Job A will starting running at 1700 on same day.

Else If Job X completes after 1700. JobA will start running at 1700 nextday.
Back to top
View user's profile Send private message
peterwu

New User


Joined: 21 Jun 2009
Posts: 3
Location: Toronto

PostPosted: Mon Jun 22, 2009 6:54 pm
Reply with quote

Understandable, but it will waste for some valuable time (max 3 hours) if job A is triggered at 1701 and waiting for 24 hours before it runs while it could be finished already.

Any idea on the time option query that it will span the next day to execute?

Thanks
Back to top
View user's profile Send private message
maheshvamsi

New User


Joined: 22 Mar 2008
Posts: 39
Location: bangalore

PostPosted: Mon Jun 22, 2009 6:59 pm
Reply with quote

I have no idea... icon_sad.gif

If you demand a job with date(like next days date) also, it will be sitting in CA7 till that time comes.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Finding and researching jobs All Other Mainframe Topics 0
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts RC query -Time column CA Products 3
No new posts How to create a list of SAR jobs with... CA Products 3
No new posts Help in Automating Batch JCL jobs mon... JCL & VSAM 3
Search our Forums:

Back to Top