× 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.



Thanks for the reply Charles




Sent via the Samsung GALAXY S® 5, an AT&T 4G LTE smartphone


-------- Original message --------
From: Charles Wilt <charles.wilt@xxxxxxxxx>
Date: 9/29/17 5:10 PM (GMT-05:00)
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: Re: How to determine if a program is being run

Sounds like a CL wrapper that self-submits and runs the program under a
specific job name is your best bet.

You can also have the CL check for & lock a specific object, either a data
area or the *PGM object itself to ensure that only one copy is active.

Charles

On Fri, Sep 29, 2017 at 2:47 PM, Alan Shore <ashore@xxxxxxxx> wrote:

Thanks for your reply Charles

I need to be able to give operations a method of ending and starting a
particular program
If the program was already running - then I don't want multiple
occurrences in the mix - so therefore - don't submit a new job
If the program is NOT running - then I don't call ENDJOB etc.

Like I said - we don't have the source to the program(s) - so I cannot put
any changes within it

I also thought of a CL wrapper - for submitting the call of the program,
but I was hoping there was something to definitively tell me that a program
was running



Alan Shore
E-mail : ASHORE@xxxxxxxx
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
'If you're going through hell, keep going.'
Winston Churchill

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of
Charles Wilt
Sent: Friday, September 29, 2017 4:27 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: Re: How to determine if a program is being run

There's no lock on a *PGM object when you run it...

AFAIK, there's no easy way to know if a program is currently being used.

QAUDJRN could track when it was started....

I suppose you could dump the call stack of every active job and look for
the program.

But for ILE, the program could still be active in a named group withing
appearing in a job's call stack.

What are you trying to accomplish?

Charles

On Fri, Sep 29, 2017 at 2:00 PM, Alan Shore <ashore@xxxxxxxx> wrote:

Hi everyone
Before I forget, we are on V7r1

Does anyone know of a way/method/process/api etc, to determine if a
program is being run

I thought of using this SQL statement (below) into a file and then
interrogate that file I got this from this web site
http://ibm.biz/DB2foriServices under Work Management Services, but I
need to know the job name involved, and who to say the program is
running under a particular job name - or if that job name is in fact
running that program


SELECT JOB_NAME, SUBSTR(JOB_NAME,1,6) AS JOB_NUMBER,
SUBSTR(JOB_NAME,8,POSSTR(SUBSTR(JOB_NAME,8), '/')-1) AS JOB_USER,
SUBSTR(SUBSTR(JOB_NAME,8),POSSTR(SUBSTR(JOB_NAME,8),'/')+1) AS
JOB_NAME2 FROM TABLE (QSYS2.ACTIVE_JOB_INFO('NO','','','')) AS X


I then thought - well if the program is running, there has to be a
lock on that program So I thought of using WRKOBJLCK, an api, the
following SQL, also from the same web page, but who is to say the lock
is due to the program running

SELECT * FROM QSYS2.OBJECT_LOCK_INFO


I need this information so that I can see if the program needs to be
ended I don't have access to the source - so I cannot change it to set
a data area

Any and all help would be MUCH appreciated


Alan Shore
E-mail : ASHORE@xxxxxxxx
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
'If you're going through hell, keep going.'
Winston Churchill

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: http://amzn.to/2dEadiD


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.