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



Daniel,

I may not understand exactly what you are trying to do, but here is what I
do:

When you do a CHAIN or a READ and the error indicator comes on (usually
indicating that the record is locked), there is a message that gets
generated containing the relevant information.  This message is in the
message field in the Program Status data structure for the program
(positions 71 - 190).

Example of the message that gets generated in the program status data
structure:
Record 5726 in use by job 699241/USERID/JOBNAME.

In our programs, we code a loop around each read or chain operation.  The
program will keep trying to retrieve the record in an endless loop.  On each
iteration, I have written a program that gets called when an I/O error
occurs.

The program trying to access the locked record passes this message to a
program which then sends it to the system operator to allow someone to
either notify the user who has the lock to get out of the program they are
running, or in the event of a batch job that has a lock they just wait until
it finishes and then respond.  Once the operator responds to the message,
the program tries again.

steve




----- Original Message ----- 
From: "Daniel Keith" <keithscc@xxxxxxxxxxx>
To: <rpg400-l@xxxxxxxxxxxx>
Sent: Friday, August 08, 2003 10:02 AM
Subject: user with a record lock


>    I am having difficultly with what I thought would be a simple thing to
do.
>
>    When a user tries to update a record that is locked by another job, I
want
>    to tell the user not only that the record is locked but who has the
record
>    locked. I am trying to use the the API QDBRRCDL since it would return
all
>    the info I would need.
>
>    I can get the Library/File/Member name from the INFDS but the all
alusive
>    relative record number I don't have because I didn't have a successful
>    file operation. The RRN comes back as a big fat ZERO.
>
>    I could do a CHAIN(N) right after my error to get the proper RRN but
that
>    seems very cumbersome and expensive. I also could leave the RRN at ZERO
>    and it would send all the records that a have a lock. That again would
>    seem cumbersome and expensive to figure out which one I really want.
>
>    Am I missing something????  Is there another API?
>
>    Daniel
>    I Cor 15:57
>
>      ---------------------------------------------------------------------
-
>
>    Protect your PC - Click here for McAfee.com VirusScan Online
> _______________________________________________
> 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-Ups:
Replies:

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.