Thanks in advance. ix...@ns.gamewood.net ixie
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
One thing you can do is allocate a message queue. Then check to see
if that is allocated before you run it, and if it is, then don't let
someone else use it. The only problem with this is it is a hassle to
deallocate the message queue if the running program bombs.
So, what we have done at our shop, is create a job lock file and
maintance program. When we call a program that can only be run one at
a time (because of temp file building, etc) we call a job lock program
with the program name. If it isn't locked, it becomes locked. If it
IS locked, an error message is sent back saying to try again later.
If a program bombs in this case, it is very easy to just go into the
file and unlock it, or even better, create a program that shows the
status of all jobs that are "lockable". If it is locked, simply
unlock it from the maintanece program.
Brad Stone
On Sat, 21 Jun 1997 13:14:37 -0600, ix...@ns.gamewood.net wrote:
>How can I determine if a program is alredy active before attempting to
>How can I determine if a program is alredy active before attempting to
>call the same program again. For example, a program is building a file
>and another user tries to run the same program - it abends. Is there CL
>to solve this problem.
>
Add a few extra commands to your CL-program
ALCOBJ &lib/&file *file *EXCL
MONMSG CPFxxxx (Look up the correct Msgid in the manual or just test it out
interactively)
build code
DLCOBJ &lib/&file *file *EXCL
Njål Fisketjøn
FIGU DATA AS
njal.fi...@figu.no
nfis...@hesgrp.com
http://www.geocities.com/SiliconValley/Pines/9037/
that allows you to determine if a specific job is running. Take the
"AS/400 Utilities" link and download ZRTVJOBSTS.
ix...@ns.gamewood.net wrote:
>How can I determine if a program is alredy active before attempting to
>call the same program again. For example, a program is building a file
>and another user tries to run the same program - it abends. Is there CL
>to solve this problem.
>Thanks in advance. ix...@ns.gamewood.net ixie
>-------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
----------------------------------------------
Herb Bujak
Mobile Data Solutions, Inc.
Work: hbu...@mdsi.bc.ca
Home: herb_...@geocities.com
http://www.geocities.com/SiliconValley/Pines/9037/
2. If the file is always created on start and deleted on end
of the procedure. Use CHKOBJ to existence check the file
before attempting to create it, or monitor for CPF message
CPF7302 after attempting to create the file.
If the application structure is such that the file can only be used by
one person at a time, You need to allocate the file as
*excl or *exclrd to prevent use. Also monitor for CPF1002 and
provide a recovery procedure and inform the workstation operator what is
happening.
Enjoy,
Leo
ix...@ns.gamewood.net wrote:
>
> How can I determine if a program is alredy active before attempting to
> call the same program again. For example, a program is building a file
> and another user tries to run the same program - it abends. Is there CL
> to solve this problem.
>
> Thanks in advance. ix...@ns.gamewood.net ixie
>
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
Best regards,
WS Jongman
--
[my modest signature]