× 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 record is locked, as pointed out earlier. If another program tries the same technique against the same file, it will go into a wait condition until the record is released.

For example, if the other program used

SETLL *Start File1
READ File1

Then, unless there is only a single record in the file, it would not go into a wait; i.e., it could do it's thing.

It's the record that's locked, Doug, not the file. Now, depending upon what the program is doing, and how long it takes to do it, this might not even be noteworthy. For example, if this is an on-line maintenance program waiting for user input, it could be bad if the user, say, goes to lunch with the record locked. A batch program that is just zipping along through the file and ding it's thing would probably not even have an impact. I typically do not bother with any special code to handle this for batch programs, but I do for interactive programs.

Jerry C. Adams
IBM System i Programmer/Analyst
B&W Wholesale
office: 615-995-7024
email: jerry@xxxxxxxxxxxxxxx


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Doug Palme
Sent: Wednesday, October 15, 2008 11:22 AM
To: RPG programming on the AS400 / iSeries
Subject: Re: Rép. : ReadP

So to expand my question a bit, and again if I am wrong, correct me.

I have the file defined as an update file with add capability.

I perform the following on that file

Setgt *hival File1
ReadP File1

So if another process attempts the SAME action, as long as I have that
record in this state it stays locked correct? Meaning no other process is
going to be able to read that file in the same manner.

From: "Denis Robitaille" <denis_robitaille@xxxxxxxxxxxx>
To: "RPG Midrange L" <rpg400-l@xxxxxxxxxxxx>
Date: 10/15/2008 11:07 AM
Subject: Rep. : ReadP

----------------------------------------------------------------------

The record read is locked, not the file.

Denis Robitaille
Directeur services technique TI
819 363 6130

SUPPORT
Jour (EST) Daytime : 819-363-6134
En-dehors des heures (EST) After hour : 819-363-6158
Network Status : 819-363-6157

>>> Doug Palme <DPalme@xxxxxxxxxxx> 2008-10-15 10:50 >>>
Correct me if I am wrong here, but when using a file in update mode
and
you perform a readp on the file, does that not lock that file?

This transmission may contain information that is privileged,
confidential
and/or exempt from disclosure under applicable law. If you are not
the
intended recipient, you are hereby notified that any disclosure,
copying,
distribution, or use of the information contained herein (including
any
reliance thereon) is STRICTLY PROHIBITED. If you received this
transmission in error, please immediately contact the sender and
destroy
the material in its entirety, whether in electronic or hard copy
format.
Thank you.
--
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.

This transmission may contain information that is privileged, confidential
and/or exempt from disclosure under applicable law. If you are not the
intended recipient, you are hereby notified that any disclosure, copying,
distribution, or use of the information contained herein (including any
reliance thereon) is STRICTLY PROHIBITED. If you received this
transmission in error, please immediately contact the sender and destroy
the material in its entirety, whether in electronic or hard copy format.
Thank you.
--
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 ...

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.