|
This is what I do.
The monitor program allocates a data area (usually the same name as the job) exclusively. Then other programs can determine if it is active by attemptnig to allocate it (with a wait time of 0).
For example.
The monitor program:
CRTDTAARA DTAARA(QGPL/DTAQJOB) TYPE(*CHAR) LEN(1)
MONMSG MSGID(CPF1023) /* already exists */
ALCOBJ OBJ((QGPL/DTAQJOB *DTAARA *EXCL)) WAIT(0)
MONMSG MSGID(CPF0000) EXEC(GOTO EOJ) /* Already active so end */
Other jobs:
ALCOBJ OBJ((QGPL/DTAQJOB *DTAARA *EXCL)) WAIT(0)
MONMSG MSGID(CPF0000) EXEC(GOTO ACTIVE)
/* if the data area can be allocated then the monitor job is not active */
DLCOBJ OBJ((QGPL/DTAQJOB *DTAARA *EXCL))
SBMJOB CMD(CALL PGM(DTAQPGM)) JOB(DTAQMON)
ACTIVE:
----- Original Message -----
From: "Bob Bledsoe" <bledsoe.bob@xxxxxxxxx>
To: "Midrange Systems Technical Discussion" <midrange-l@xxxxxxxxxxxx>
Subject: Re: Dtaq/ UsrQ Monitor
Date: Mon, 16 Mar 2009 10:24:19 -0700
Well I need a lot of education on queues. But that said I think Albert
somehow came up with what I'm looking for. How do I tell if the program that
which monitors the queue is active?
Thanks
Bob B
On Mon, Mar 16, 2009 at 10:05 AM, Albert York <albertyork@xxxxxxxxx> wrote:
If the queue exists then it is active. You don't have to start it.--
To check if the queue exists use the CHKOBJ command.
Do you mean that you want to know if the program which monitors the queue
is active?
Albetr
----- Original Message -----anywork
From: "Bob Bledsoe" <bledsoe.bob@xxxxxxxxx>
To: "Midrange Systems Technical Discussion" <midrange-l@xxxxxxxxxxxx>
Subject: Re: Dtaq/ UsrQ Monitor
Date: Mon, 16 Mar 2009 09:41:55 -0700
The problem here is that I'm not sure what I mean. I have not done
with the datq or usrq before. The program is calling another progran thatis
used to start the queue. I don't want to start the queue if it is alreadywrote:
there and active. How do I know if the queue is there and active?
Thanks,
Bob
On Mon, Mar 16, 2009 at 9:36 AM, Alan Campin <alan0307d@xxxxxxxxx>
DoNot sure what you mean by instance? Do you mean a message in the queue?
Queue?you mean how do you monitor for a message in a Data Queue or User
toI have a service program that implements functions that read and write
usrq's.user queues if that is what you need.
On Mon, Mar 16, 2009 at 10:22 AM, Bob Bledsoe <bledsoe.bob@xxxxxxxxx>
wrote:
Good Morning,
I am writing a RPGLE program where I will be starting Dtaq's and
thatI
want to monitor so that I only start up an instance when there are no
instances currently. I have looked around but can't find anything
mailingshows
how to do the monitor. Can someone please give me a push in the right
direction?
Thank you,
Bob B
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
listlist
To post a message email: MIDRANGE-L@xxxxxxxxxxxx--
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
> This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailingTo post a message email: MIDRANGE-L@xxxxxxxxxxxx--
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx--
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
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: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
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: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
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.