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

Running a particular step of a job in a specific time


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Mahua Mitra

New User


Joined: 26 Apr 2007
Posts: 49
Location: Delhi

PostPosted: Thu May 24, 2007 12:16 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu May 24, 2007 12:22 pm
Reply with quote

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
View user's profile Send private message
Mahua Mitra

New User


Joined: 26 Apr 2007
Posts: 49
Location: Delhi

PostPosted: Thu May 24, 2007 12:36 pm
Reply with quote

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
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Canada

PostPosted: Thu May 24, 2007 12:40 pm
Reply with quote

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
View user's profile Send private message
Mahua Mitra

New User


Joined: 26 Apr 2007
Posts: 49
Location: Delhi

PostPosted: Thu May 24, 2007 12:58 pm
Reply with 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')

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
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Thu May 24, 2007 1:07 pm
Reply with quote

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
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Canada

PostPosted: Thu May 24, 2007 1:09 pm
Reply with quote

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
View user's profile Send private message
ramfrom84

New User


Joined: 23 Aug 2006
Posts: 93
Location: chennai

PostPosted: Thu May 24, 2007 1:24 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu May 24, 2007 3:48 pm
Reply with quote

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
View user's profile Send private message
balajiofcrrcoe

New User


Joined: 07 Jul 2005
Posts: 41
Location: chennai

PostPosted: Thu May 24, 2007 4:19 pm
Reply with quote

I have an idea icon_idea.gif

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu May 24, 2007 4:27 pm
Reply with quote

balajiofcrrcoe wrote:
I have an idea icon_idea.gif

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu May 24, 2007 8:42 pm
Reply with quote

Hello,

Please explain what business reason there is to keep three activities that must happen 1 hour apart in the same job icon_confused.gif

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
View user's profile Send private message
shane

New User


Joined: 17 May 2007
Posts: 11
Location: Phoenix,Arizona

PostPosted: Fri May 25, 2007 1:52 am
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri May 25, 2007 12:44 pm
Reply with quote

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
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Fri May 25, 2007 1:14 pm
Reply with quote

expat is talking about scheduling products like CA-7.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri May 25, 2007 1:47 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri May 25, 2007 5:53 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri May 25, 2007 6:12 pm
Reply with quote

oh ... I could not read expat reply before posting my reply. Thanks expat.
It means my thought process was right.

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

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon May 28, 2007 6:29 am
Reply with quote

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
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Running REXX through JOB CLIST & REXX 13
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 Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts C Compile time time stamps Java & MQSeries 10
Search our Forums:

Back to Top