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

Jcl to check long running jobs in spool


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

New User


Joined: 05 Dec 2006
Posts: 83
Location: Bangalore

PostPosted: Fri Nov 13, 2009 7:06 pm
Reply with quote

Hi,

Can anyone help me with the below requirements.

I need to create a job which will monitor and notify about
1. the jobs running in spool for long time and
2. when more no of jobs are waiting in queue to run
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Nov 13, 2009 7:10 pm
Reply with quote

How will your job access these details? Or, in other words, what program(s) or utilitiy(ies) will this process use?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Fri Nov 13, 2009 7:11 pm
Reply with quote

that' s just what schedulers and automation packages/products are for
You will find little help in reinventing the wheel!
Back to top
View user's profile Send private message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 83
Location: Bangalore

PostPosted: Mon Nov 16, 2009 12:23 pm
Reply with quote

Hi,

Can you let me know any utilities or automation packages that help me in achieving this. We have a CA7 scheduler in our system, but currently it does not notify us of any long running jobs or when queue is heavy.

i have some experience in JCL but i am not sure how to proceed for this requirement or what pgm i should use to achieve this.

Any help will be greatly appreciated.
Back to top
View user's profile Send private message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 83
Location: Bangalore

PostPosted: Mon Nov 16, 2009 5:27 pm
Reply with quote

superk and enrico,

if i am not clear and more details are needed. kindly let me know.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Mon Nov 16, 2009 6:16 pm
Reply with quote

Long running? 2 seconds, 5 minutes, 24 hours? First you have to define that, then you can for example use SMF information to get the long running jobs. The jobs waiting in queue are probably waiting for the long running jobs. Maybe long running job classes are defined, then find all the jobs with that class in SMF or jcl libraries. Just a few examples.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Nov 16, 2009 6:26 pm
Reply with quote

Peter, I believe this is a "instant analysis" type request rather than being able to get the stats from SMF at a later time.

But once again, an ill defined request. As you have said - we have no idea of what is long running. Come to think of it, when did jobs start to run in the spool anyway, I usually use an initiator.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Mon Nov 16, 2009 6:38 pm
Reply with quote

expat,

splitting hairs huh? (about the spool thing) icon_smile.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Mon Nov 16, 2009 6:43 pm
Reply with quote

nahh icon_biggrin.gif
the proper term is... tetrapyloctomy
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Nov 16, 2009 6:45 pm
Reply with quote

PeterHolland wrote:
splitting hairs huh? (about the spool thing) icon_smile.gif

Or was it spitting feathers icon_lol.gif

Well, yes and know. I guess I was brought up to use the correct terminology and if everyone does, it just makes life easier for all concerned.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon Nov 16, 2009 9:57 pm
Reply with quote

Hello,

What do you want that cannot be seen in sdsf? (note, sdsf can be used in batch)

There are some sdsf/jcl topics in the forum.

You might also consider RMF. . .
Back to top
View user's profile Send private message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 83
Location: Bangalore

PostPosted: Tue Nov 17, 2009 9:41 am
Reply with quote

Hi all,

Long running jobs meant jobs that go into looping due to some data issue or table contention.

In our system we have thruput agents defined for job names, so only one job can run at a time. Other jobs will be on hold to avoid contention with table. So there were cases where jobs keep looping or many jobs(usually > 1000) are there in queue waiting for it to complete.


Im not asking a solution for long running job. Im asking for a alarm job or monitor job which can notify if some job is running more than 10 mins or there are more than 1000 jobs in queue waiting to execute.
Back to top
View user's profile Send private message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 83
Location: Bangalore

PostPosted: Tue Nov 17, 2009 9:43 am
Reply with quote

Dick,
My requirement can checked in SDSF. but it would require continuous monitoring. so i just wanted to automate it.
Any pgms or utilities or tools that i can use to achieve this.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Nov 17, 2009 9:53 am
Reply with quote

Hello,

Create a batch process that will check for what you want.

Once this works as a single submission, have it scheduled to run as needed (hourly, every 15 minutes, whatever works).

Personally, i believe time would be well spent preventing the problem rather than detecting it. Until the process(es) can be corrected, detection might help, but the best solution is to fix the processes.
Back to top
View user's profile Send private message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 83
Location: Bangalore

PostPosted: Tue Nov 17, 2009 10:33 am
Reply with quote

I Posted in this forum so i can get some help in creating the batch process. Any materials u know that will help me in using sdsf in batch so i can read spool and check the data required like job running time or CPU time and no of jobs running in spool currently.

Can i achieve this using only JCL or REXX too? which one will be a better option, any idea.[/quote]
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Nov 17, 2009 10:39 am
Reply with quote

Hello,

Well, you can't do this with only jcl - because jcl does exactly nothing. . . All jcl can do is execute programs.

As i mentioned earlier, there are some sdsf/jcl topics in the forum. Look thru some of these and find somethng close to what you want to do.

If you find something in these topics that is not clear, post what you found and your doubt. Someone will be able to clarify.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Nov 17, 2009 12:42 pm
Reply with quote

Huzefa wrote:
and no of jobs running in spool currently.

Can i achieve this using only JCL or REXX too? which one will be a better option, any idea.

/RANT ON
Once more let us clarify exactly what JCL is.

it is Job Control Language.

By itself it does nothing. It is used to invoke the chosen program and to define which datasets are to be used by the DD names associated with the chosen program.

JCL does not have magical powers that solve all problems, JCL is merely the vehicule for telling the processor which program you want it to execute.
/RANT OFF

So, if you might just care to tell us which program you wish the JCL to execute, we might be able to help you. Dick has mentioned SDSF in batch. So what you do in terminal SDSF you can achieve in batch SDSF with a REXX driver.

Also, please note. JOBS DO NOT RUN IN THE SPOOL. They run in an initiator, the whole initiator, and nothing but the initiator.

As dick has also suggested, prevention is the better bet. Does the quality control processes in place not check for these conditions. Because if you go along with a REXX/SDSF solution you will tie up an initiator (Or maybe a sppol icon_cry.gif ) for as long as you perform the monitoring. What a WASTE of resource.
Back to top
View user's profile Send private message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 83
Location: Bangalore

PostPosted: Tue Nov 17, 2009 4:57 pm
Reply with quote

Expat,

thanks for your clarification. actually i posted this to know which program i should use to read SDSF in batch. As per Dick i tried searching for sdsf\jcl topics but i could not find any. May be i am searching in the wrong places. any links or materials regarding this will be of gr8 help.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Nov 17, 2009 9:17 pm
Reply with quote

Hello,

In the dark blue line near the top of the page, there is a SEARCH feature. When i use "sdsf" and "jcl" (without the quotes) as the keywords and click the "Search for all terms", i get "Search found 121 matches"

Suggest you look thru these and see if something is close to what you want to do.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2593
Location: Silicon Valley

PostPosted: Wed Nov 18, 2009 12:45 am
Reply with quote

Quote:
Long running jobs meant jobs that go into looping

Should be handled by TIME= parameter on the job card... the system will cancel if the time is exceeded.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Nov 18, 2009 12:59 am
Reply with quote

What - you mean TIME=1440 shouldn't be used. . . icon_cool.gif
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1248
Location: Richfield, MN, USA

PostPosted: Wed Nov 18, 2009 8:29 am
Reply with quote

dick scherrer wrote:
What - you mean TIME=1440 shouldn't be used. . . icon_cool.gif
Most certainly not, Dick. Use TIME=NOLIMIT instead. icon_lol.gif icon_lol.gif
Back to top
View user's profile Send private message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 83
Location: Bangalore

PostPosted: Tue Nov 24, 2009 3:08 pm
Reply with quote

this is what i was looking for.
www.ibmmainframes.com/viewtopic.php?p=215959#215959
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 Using Multiple IFTHEN and WHEN condit... SYNCSORT 12
No new posts Check if CICS is online in JCL CICS 10
No new posts SPOOL to Mainframe dataset in batch mode JCL & VSAM 7
No new posts How to turn off 'ACTION' SDSF output ... TSO/ISPF 2
No new posts Finding and researching jobs All Other Mainframe Topics 0
Search our Forums:

Back to Top