× 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 only problem with this approach is that you cannot save the library
>while the program is running, even if you use save while active, because
you
>can't get a lock on it. 

That's because you have too much of a lock. Try this way:

ALCOBJ OBJ((THEPROGRAM *PGM *EXCL))
MONMSG CPF1002 exec(GOTO INUSE)
ALCOBJ OBJ((THEPROGRAM *PGM *SHRRD))
DLCOBJ OBJ((THEPROGRAM *PGM *EXCL))

By the time this is done you'll only have a shared read lock and you can
backup through that, however if someone else have the shared read lock then
you can't get the exclusive to start with. You'll hold the exclusive for
such a short period of time that the backup should wait for the object on
the off chance that you try to backup the program when the program is locked
exclusively.

-Walden


------------
Walden H Leverich III
President
Tech Software
(516) 627-3800 x11
(208) 692-3308 eFax
WaldenL@xxxxxxxxxxxxxxx
http://www.TechSoftInc.com 

Quiquid latine dictum sit altum viditur.
(Whatever is said in Latin seems profound.)
 
-----Original Message-----
From: York, Albert [mailto:albert.york@xxxxxxxxxxxxxx] 
Sent: Thursday, October 23, 2003 3:18 PM
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: Best way to check if a program is running

The only problem with this approach is that you cannot save the library
while the program is running, even if you use save while active, because you
can't get a lock on it.

I prefer to lock a data area in a separate library with the same name as the
program, or with a more descriptive name such as FILEMAINT. You can then put
information in the data area, such as the last time the job ran and the job
name.

Albert York                          


        -----Original Message-----
        From:   Lance Gillespie [SMTP:lgillespie@xxxxxxxx]
        Sent:   Thursday, October 23, 2003 11:30 AM
        To:     rpg400-l@xxxxxxxxxxxx
        Subject:        RE: Best way to check if a program is running

        > The program I'm trying to find running is a file maintenance
program.

        In that case you can change the CL to obtain an exclusive lock on 
        itself first thing.  If the lock fails, someone else is running the
        program
        so quit.  
        _______________________________________________
        This is the RPG programming on the AS400 / iSeries (RPG400-L)
mailing list
        To post a message email: RPG400-L@xxxxxxxxxxxx
        To subscribe, unsubscribe, or change list options,
        visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
        or email: RPG400-L-request@xxxxxxxxxxxx
        Before posting, please take a moment to review the archives
        at http://archive.midrange.com/rpg400-l.
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-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.