View previous topic :: View next topic
|
Author |
Message |
Mahua Mitra
New User
Joined: 26 Apr 2007 Posts: 49 Location: Delhi
|
|
|
|
Hi
Say one job has 3 steps : step-a, step-b, step-c.
step-a and step-c must run at 2 and 4 PM . The requiremnet is to run step-b at 3 pm.
Is there any way in which we can do it having all these 3 steps in a single Job itself? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Do you have a schedule package, if so, use it. That is exactly what it does.
Three jobs, allascheduled on time, and dependencies accounted for too. |
|
Back to top |
|
|
Mahua Mitra
New User
Joined: 26 Apr 2007 Posts: 49 Location: Delhi
|
|
|
|
They are 3 different steps of the same job. My requirement is these e steps have to be in the same job. |
|
Back to top |
|
|
muthuvel
Active User
Joined: 29 Nov 2005 Posts: 217 Location: Canada
|
|
|
|
To my knowledge,within a single job,three steps can't be scheduled to run at different time.This is possible only by making three seperate jobs. |
|
Back to top |
|
|
Mahua Mitra
New User
Joined: 26 Apr 2007 Posts: 49 Location: Delhi
|
|
|
|
is the following condition possible?
Job runs at 2PM, 3PM and 4PM.
Step-a runs at 2(return code 'X'), 3(return code 'X') ,4(return code 'X')
Now Step-b runs at 2, 3 and 4 but abends if the return code of Step-a at 4PM is 'X'.
Thanks |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Mahua ,
Quote: |
Now Step-b runs at 2, 3 and 4 but abends if the return code of Step-a at 4PM is 'X'. |
You mean to say at 4PM you would like to abend step-b basing on step-a RC. If this is the case, step-c never executes (I guess it is present after step-b).
Using COND parameter/IF condition, make step-b to skip. |
|
Back to top |
|
|
muthuvel
Active User
Joined: 29 Nov 2005 Posts: 217 Location: Canada
|
|
|
|
Better have them as seperate jobs,In your first post ,you have mentioned as
Quote: |
Say one job has 3 steps : step-a, step-b, step-c.
step-a and step-c must run at 2 and 4 PM . The requiremnet is to run step-b at 3 pm.
Is there any way in which we can do it having all these 3 steps in a single Job itself? |
Have step-a and step-c as one job1 and step-b as another job2.
run job1 at 2 and 4 p.n.run job-2 at 3 p.m.keepp job-2 to run dependancies if needed. |
|
Back to top |
|
|
ramfrom84
New User
Joined: 23 Aug 2006 Posts: 93 Location: chennai
|
|
|
|
Pls check the below . This will work in our shop.
//STEP2
//DELAY EXEC PGM=EXCMDWP,PARM='00000500,D T'
//STEP3
THIS WILL HALT 500 SEC TO START STEP3
Disadvantage: it will consume CPU Time for the delay state. u can follow this method as the worst case.
Suggestion : some experts from REXX can write code to hold the job for delay state and active this job when needed..
Bye.. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Quote: |
THIS WILL HALT 500 SEC TO START STEP3 |
OK, so how are you going to know in advance exactly how long the previous step will run for as to calculate the required delay.
The requirement that it must be one job is ludicrous. If things need to run at a certain time for a given reason, which I have asked for but not yet been given, thenm three jobs is the correct way to go.
What if step1 runs until 15:20 ??? |
|
Back to top |
|
|
balajiofcrrcoe
New User
Joined: 07 Jul 2005 Posts: 41 Location: chennai
|
|
|
|
I have an idea
we can have a loop before to the step which needs to be run at 3
to accept the system time
if time = 3
set return code of the step
based on the above step return code we would run the step at 3 |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
balajiofcrrcoe wrote: |
I have an idea
we can have a loop before to the step which needs to be run at 3
to accept the system time
if time = 3
set return code of the step
based on the above step return code we would run the step at 3 |
Yes, you can. I've written one in REXX and it eats CPU like there's no tomorrow. Is that what you want to do - use copious amounts of resource for no reason, and to impact other users on the system.
What about the JES exits that may well abend the job once a certain amount of CPU has been consumed. Did you think of that ?
I maintain that the use of a schedule package is the most efficient and foolprof way to do this. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Please explain what business reason there is to keep three activities that must happen 1 hour apart in the same job
There is no good reason to have the job sit idle in the initiator for multiple hours waiting for some hour to occur. Imagine if many jobs like this were submitted - your mainframe would come to a complete halt - everything would be "busy" doing nothing.
Hopefully, management there would not allow this type of job to be turned over as production.
Proper jcl and scheduling will serve you much better. |
|
Back to top |
|
|
shane
New User
Joined: 17 May 2007 Posts: 11 Location: Phoenix,Arizona
|
|
|
|
Hi,
I think this query is something like HOMEWORK.
Whatever may be we can use schedule package for this as also said by expat.
schedule package is meant for this things only |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
expat wrote: |
Do you have a schedule package,
|
Expat,
A small query:
Are you talking about the package which is sechduled to be installed in production or is the above notion used for some other term.
If it is for some other term, please let me know a bit about this. |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
expat is talking about scheduling products like CA-7. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Quote: |
expat is talking about scheduling products like CA-7. |
Thank you Abhijit.
Other schedule packages include
OPC (Now known as TWS), CONTROL-M, JobTrac, Zeke |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Thanks Abhijit.
Does that mean, I can rephrase expat line, in my perception,as :
"Do you have a schedule product(s); products which provide the facility to create/update a JOB sechduler."
Please suggest. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
oh ... I could not read expat reply before posting my reply. Thanks expat.
It means my thought process was right.
Thanks. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi MM,
You said:
Quote: |
is the following condition possible?
Job runs at 2PM, 3PM and 4PM.
Step-a runs at 2(return code 'X'), 3(return code 'X') ,4(return code 'X')
|
This seems to indicate you have the ability to schedule the job for execution at the times you desire. If so, you can try this:
At 2PM exec the job w/this job card:
//EXEC2PM JOB (xx),'yy',MSGCLASS=X,CLASS=Y,
// RESTART=STEPA,COND=(0,LE),
// NOTIFY=ZZZZ
At 3PM exec the job w/this job card:
//EXEC3PM JOB (xx),'yy',MSGCLASS=X,CLASS=Y,
// RESTART=STEPB,COND=(0,LE),
// NOTIFY=ZZZZ
At 4PM exec the job w/this job card:
//EXEC4PM JOB (xx),'yy',MSGCLASS=X,CLASS=Y,
// RESTART=STEPC,COND=(0,LE),
// NOTIFY=ZZZZ
What this does is executes ONLY STEPA at 2PM; executes ONLY STEPB at 3PM and executes ONLY STEPC at 4PM.
The RESTART/COND allows only the RESTART step to execute; all other steps in the job are by-passed. |
|
Back to top |
|
|
|