|
Hi István, I'm not sure why you need a 2nd "cheated" file. SETLL does not read a record from the file, it simply sets (or doesn't set) the file pointer based on the access path. Even if it finds a match, none of the fields from any previous chain or read are touched. I haven't seen many programs that would have to worry about the file pointer since it's rare that you are sequentially reading a file and adding to it at the same time. It's true that job log length is not a problem disk-space wise in these days of cheap (relatively) disks, but wading through hundreds or thousands of pages to see what happened is time consuming. But even that isn't the real problem to me. The problem is the performance hit that occurs when a program has to handle an error. And actually, in an interactive program, that's not a big deal either. It's those batch jobs adding thousands or millions of records where you really notice the difference. Truth to tell, most of the programming I've been doing over the last n years has been of the maintenance variety, enhancing or fixing vendor software. The 3 methods I've seen mostly are 1) WRITE with error indicator, 2) SETLL with equal indicator, or 3) lock a data area that contains next unique sequence#. The programs I've written use SETLL only, and they've never had a problem. If you are concerned about saving the contents of a file, another method besides prefixing is to use a named externally-defined multi-occurrence (2 occurrences) data structure. Just change the occurrence# before doing the CHAIN or READ. Or have two separate data structures. This works in RPG III or RPG IV. Regards, Peter Dow Dow Software Services, Inc. 909 425-0194 voice 909 425-0196 fax > +--- > | This is the RPG/400 Mailing List! > | To submit a new message, send your mail to RPG400-L@midrange.com. > | To subscribe to this list send email to RPG400-L-SUB@midrange.com. > | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. > | Questions should be directed to the list owner/operator: david@midrange.com > +--- __________________________________________________ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.