× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Gary,

First thing I'd think about is "How do you know if the job is running?"

Is that based on the job name? If so, what if someone else runs the same job name?

Is it based on a particular program being active in the call stack?

Is it based on a lock on a particular object? (This works nicely in my experience...)

Once you've figured that out, you can think about how to detect it...

QUSLJOB works nicely if you want to check if a job with a particular name is active, just dump the list of active jobs to a user space, and spin through it to find if something matches that name. But, that assumes that a job name is a good way to identify it... which it may not be.

For a program in the call stack it can get much uglier, you do QUSLJOB and then for each job dump it's call stack and spin through that.

Object locks are a very simple/easy way to check... if applicable...


On 11/19/2014 3:23 PM, Gary Thompson wrote:
I want to submit job x, but only if not running.
I don't want spool file madness of DSPJOB/WRKJOB so
maybe I want QUSLJOBI API ?
Current project uses QUSLMBR so maybe I make
a cmd that takes job name and returns y/n if active
job found with that name - what's easier ?


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.