Discussion:
lckw
(too old to reply)
Truffle
2004-06-18 23:13:38 UTC
Permalink
Hi

I am not a programmer, but can cobble simple cl programs together. I have a
couple of batch jobs that sometimes go into a lckw status, which holds
everything else up (its unavoidable). Is there some simple program I can
write in CL to monitor for this, and in the event of, send a message to
qsysopr msgq (i could then pick this up and use an application we have to
send me a text message)? I'm running v4r4.

Many thanks in advance
Ken
2004-06-19 03:42:26 UTC
Permalink
Hi -
Post by Truffle
I am not a programmer, but can cobble simple cl programs together. I have a
couple of batch jobs that sometimes go into a lckw status, which holds
everything else up (its unavoidable). Is there some simple program I can
write in CL to monitor for this, and in the event of, send a message to
qsysopr msgq (i could then pick this up and use an application we have to
send me a text message)? I'm running v4r4.
You could use the QUSLJOB API to get a list of jobs that you want to
monitor. Use format JOBL0200 and request key 0101 (active job
status). Loop through the user space looking for jobs with an active
job status of LCKW. SNDPGMMSG your message to QSYSOPR for each one
found (or collect a count and send one message to QSYSOPR or whatever
suits your need).

Repeat this process using a DLYJOB to wait between checks.
--
Ken
http://www.ke9nr.net/
Opinions expressed are my own and do not necessarily represent the views of my employer or anyone in their right mind.
QMAGIC
2004-06-22 22:39:39 UTC
Permalink
Post by Ken
Hi -
Post by Truffle
I am not a programmer, but can cobble simple cl programs together. I have a
couple of batch jobs that sometimes go into a lckw status, which holds
everything else up (its unavoidable). Is there some simple program I can
write in CL to monitor for this, and in the event of, send a message to
qsysopr msgq (i could then pick this up and use an application we have to
send me a text message)? I'm running v4r4.
You could use the QUSLJOB API to get a list of jobs that you want to
monitor. Use format JOBL0200 and request key 0101 (active job
status). Loop through the user space looking for jobs with an active
job status of LCKW. SNDPGMMSG your message to QSYSOPR for each one
found (or collect a count and send one message to QSYSOPR or whatever
suits your need).
Repeat this process using a DLYJOB to wait between checks.
I suggest you do a little research on monitoring a message queue. The
CLP could watch for the record lock message and then call a program to
send the message on.

Try seraching www.seach400.com in addition to this group.

Hope it helps.
Dan
Ken
2004-06-23 02:49:59 UTC
Permalink
Hi Dan -
Post by QMAGIC
I suggest you do a little research on monitoring a message queue. The
CLP could watch for the record lock message and then call a program to
send the message on.
Two problems with your suggestion:

1. You replied to me rather than to the original poster.

2. There will be no message to a message queue until the LCKW ends,
which could be seconds, minutes, hours, or even never [a record lock
with WAITRCD(*NOMAX)].
--
Ken
http://www.ke9nr.net/
Opinions expressed are my own and do not necessarily represent the views of my employer or anyone in their right mind.
Truffle
2004-07-01 20:01:58 UTC
Permalink
Thanks Dan, I'll read up on API's, though search400 seems to be down at the
moment.
Post by QMAGIC
Post by Ken
Hi -
Post by Truffle
I am not a programmer, but can cobble simple cl programs together. I have a
couple of batch jobs that sometimes go into a lckw status, which holds
everything else up (its unavoidable). Is there some simple program I can
write in CL to monitor for this, and in the event of, send a message to
qsysopr msgq (i could then pick this up and use an application we have to
send me a text message)? I'm running v4r4.
You could use the QUSLJOB API to get a list of jobs that you want to
monitor. Use format JOBL0200 and request key 0101 (active job
status). Loop through the user space looking for jobs with an active
job status of LCKW. SNDPGMMSG your message to QSYSOPR for each one
found (or collect a count and send one message to QSYSOPR or whatever
suits your need).
Repeat this process using a DLYJOB to wait between checks.
I suggest you do a little research on monitoring a message queue. The
CLP could watch for the record lock message and then call a program to
send the message on.
Try seraching www.seach400.com in addition to this group.
Hope it helps.
Dan
Brian
2004-07-01 21:25:37 UTC
Permalink
First, find out which object is locked, the object your job is waiting for.
Then you can allocated it with ALCOBJ command. Specify a reasonable value
for the WAIT parameter. Monitor for message CPF1002, and if received, send
your notification message to QSYSOPR. If ALCOBJ is successful, release your
lock on the object with DLCOBJ command.
Post by Truffle
Thanks Dan, I'll read up on API's, though search400 seems to be down at the
moment.
Post by QMAGIC
Post by Ken
Hi -
Post by Truffle
I am not a programmer, but can cobble simple cl programs together. I
have a
Post by QMAGIC
Post by Ken
Post by Truffle
couple of batch jobs that sometimes go into a lckw status, which holds
everything else up (its unavoidable). Is there some simple program I
can
Post by QMAGIC
Post by Ken
Post by Truffle
write in CL to monitor for this, and in the event of, send a message to
qsysopr msgq (i could then pick this up and use an application we
have
Post by Truffle
to
Post by QMAGIC
Post by Ken
Post by Truffle
send me a text message)? I'm running v4r4.
You could use the QUSLJOB API to get a list of jobs that you want to
monitor. Use format JOBL0200 and request key 0101 (active job
status). Loop through the user space looking for jobs with an active
job status of LCKW. SNDPGMMSG your message to QSYSOPR for each one
found (or collect a count and send one message to QSYSOPR or whatever
suits your need).
Repeat this process using a DLYJOB to wait between checks.
I suggest you do a little research on monitoring a message queue. The
CLP could watch for the record lock message and then call a program to
send the message on.
Try seraching www.seach400.com in addition to this group.
Hope it helps.
Dan
Loading...