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



The code was just meant as an example.

You could also just precede the ALCOBJ with a CHKOBJ and submit the job if the data area doesn't exist.

I actually bundle all of this into a seperate API which does the create, allocate, sbmjob, etc. You just pass it the name of the job (data area) and the program to call (assuming you are using a standard job queue).

Albert



----- Original Message -----
From: rob@xxxxxxxxx
To: "Midrange Systems Technical Discussion" <midrange-l@xxxxxxxxxxxx>
Subject: Re: Dtaq/ UsrQ Monitor
Date: Mon, 16 Mar 2009 14:04:33 -0400


Another reason why I hate CPF0000 messages...
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:

What happens if the data area doesn't exist? After all, your monitor job
builds it so plainly it is not expected to be there on startup.
Actually, the exception messages for ALCOBJ suck. You have to monitor for
CPF1085, then you have to find the diagnostic messages as to why CPF1085
failed. These could include:
CPF0939 - Object BUFU type *DTAARA was not found in library ROB.
CPF0952 - Library BUFU not found for *DTAARA BUFU.
CPF0986 - No authority to library DUMMYX.
CPF0991 - No authority to object BUFU in library DUMMYX type *DTAARA.

So it may be
ALCOBJ OBJ((QGPL/DTAQJOB *DTAARA *EXCL)) WAIT(0)
MONMSG MSGID(CPF1085) EXEC(GOTO wtf)
/* if the data area can be allocated then the monitor job is not active */
DLCOBJ OBJ((QGPL/DTAQJOB *DTAARA *EXCL))
FireUp:
SBMJOB CMD(CALL PGM(DTAQPGM)) JOB(DTAQMON)
goto mainBody

wtf:
RCVMSG ... MSGID(&MSGID) ...
If &msgid='CPF0939' THEN(GOTO FireUp) /* *DTAARA does not exist */
/* Unknown error - alert the troups */
DMPCLPGM
DSPJOBLOG OUTPUT(*PRINT)
DSPJOB OUTPUT(*PRINT)
GOTO fo
mainBody:
...
fo:
ENDPGM

Rob Berendt
--
Group Dekko Services, LLC
Dept 01.073
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





From:
"Albert York" <albertyork@xxxxxxxxx>
To:
"Midrange Systems Technical Discussion" <midrange-l@xxxxxxxxxxxx>
Date:
03/16/2009 01:41 PM
Subject:
Re: Dtaq/ UsrQ Monitor
Sent by:
midrange-l-bounces@xxxxxxxxxxxx



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 -----
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
anywork
with the datq or usrq before. The program is calling another progran
that
is
used to start the queue. I don't want to start the queue if it is
already
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>
wrote:

Not sure what you mean by instance? Do you mean a message in the
queue?
Do
you mean how do you monitor for a message in a Data Queue or User
Queue?

I have a service program that implements functions that read and
write
to
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
usrq's.
I
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
that
shows
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)
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.


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


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



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


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.