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



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


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.