× 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 keyword Alan is referring to is EXTFILE. I use it all the time to
process the same file in a number of different libraries - you close the
file if it's open, move the qualified file name into a 21 byte string
variable, then open the file.

But back to the original question - I can't see why you don't have a logical
file over this, or use embedded SQL. You will have to read the entire file
to find the record you want. It's like cutting down a tree to make a one
toothpick.

Francis Lapeyre
IS Dept. Programmer/Analyst
Stewart Enterprises, Inc.


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Alan C
Sent: Thursday, April 28, 2005 9:21 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Update a particular record in a sequential file

You can also "simulate" an "unkeyed logical over the file" by defining a
full-procedural file in the F-specs with a name different from the physical
file, but override the name to the physical file both at compile and then
run time.

F filename      I F E   DISK
F filename1    I F E    DISK rename ( pfrecord : pfrecord1 )
                                            usropn

Then call QCMDEXC to override it, or if you're on V5R3 or maybe V5R2  I
think you can define the override on the F-specs keywords. (Right?)

Then open it and off you go.

- Alan


>This is stupid, but you could create an unkeyed logical over the file, 
>read from it or the physical till you find the record you want, then 
>chain to the other by rrn and do the update.  If you use SQL it's 
>either going to create an index or go through the file sequentially. 
>The O/S chooses for you. An important thing to realize is that blocked 
>sequential reads to a file go very fast.  If there are fewer than a
>million records in the file it's darned quick.   
>  
>

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