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



I still prefer a data area. I have learned that not all locks are the same.
For example, if you try to lock a DDM file it will try to connect to the
remote system, which can hang your job. Locking a program will prevent if
from being available for backups, if you need to do a save while active, and
will prevent you from being able to duplicate the program if you need to.

That is why I use a special library and put all of my data areas in there. I
have created a utility called JOBSTS (job status) which will create the
library and data area as needed and either return the status or lock it, as
requested. I can call JOBSTS from a CL program or an RPG program.

Albert York


        -----Original Message-----
        From:   Dan Bale [SMTP:dbale@samsa.com]
        Sent:   Wednesday, April 10, 2002 9:49 AM
        To:     midrange-l@midrange.com
        Subject:        RE: Monitor for existing job.

        Ahhh, now I understand!  <slap on forehead>  Of course, why create a
data
        area to lock since you'll use the same determination as you're using
in your
        example, i.e., locking the program object.

        I will say that I'm still leaning towards the data area when wanting
*EXCL
        locks on RPG program objects for the simple reason that I can easily
perform
        the data area lock *inside* the application via *LOCK IN, as someone
gave an
        example for earlier in this thread.  If you try to allocate the
program
        object outside, and before you call, the program, you haven't
prevented the
        possibility that some other job may attempt to directly call the
program,
        and avoid the CL wrapper app altogether.  Obviously, if it's a CL
app you
        want to "lock", you could do that right in the app.

        - Dan Bale
        (I am *NOT* "Dale"
        http://archive.midrange.com/midrange-l/200105/msg00281.html )
        SAMSA, Inc.
        989-790-0507
        DBale@SAMSA.com <mailto:DBale@SAMSA.com>
          Quiquid latine dictum sit altum viditur.
          (Whatever is said in Latin seems profound.)

        -----Original Message-----
        From: midrange-l-admin@midrange.com
        [mailto:midrange-l-admin@midrange.com]On Behalf Of Carsten Flensburg
        Sent: Tuesday, April 09, 2002 3:05 PM
        To: midrange-l@midrange.com
        Subject: Re: Monitor for existing job.


        Dan,

        The lock as such does not prevent the program being called directly.

        The idea is to always call the program through the CL-program that
will
        perform the check for an existing lock against the program.  Similar
to the
        "lock data area" approach - but instead of using yet another object
I
        decided that the program object itself would be just as good a lock
target.
        And the CL-program provides a generic solution - if there are no
parameters
        involved in the call.

        Best regards,
        Carsten Flensburg

        ----- Original Message -----
        From: "Dan Bale" <dbale@samsa.com>
        To: <midrange-l@midrange.com>
        Sent: Tuesday, April 09, 2002 8:20 PM
        Subject: Re: Monitor for existing job.


        Carsten, I just tried ALCOBJ *EXCL on an program object in one job
and was
        able to call it in another job.  Which was the gist of what your
code in the
        archive post was getting at.  Did I miss something else that your
code was
        doing?

        In fact, when I do a WRKOBJLCK on that program, I see the job where
I did
        the ALCOBJ, but not the job that currently is running it.  I have
never
        understood this mystery.

        I think that locking the data area is the easiest and most reliable
way to
        go.

        - Dan Bale
        offsite today
        ---------- Original Message ----------------------------------
        From: "Carsten Flensburg" <flensburg@novasol.dk>
        Reply-To: midrange-l@midrange.com
        Date:  Tue, 9 Apr 2002 19:27:30 +0200

        >And here's something along the same lines - using the program
itself as
        lock
        >object - from the archives:
        >http://archive.midrange.com/midrange-l/199911/msg01701.html
        >
        >Best regards,
        >Carsten Flensburg

        _______________________________________________
        This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing list
        To post a message email: MIDRANGE-L@midrange.com
        To subscribe, unsubscribe, or change list options,
        visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
        or email: MIDRANGE-L-request@midrange.com
        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.