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



Thanks Scott!!!

I will try that...i will pad the "string" with blanks, then overwrite them
to that same padded length. That should work.



-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Scott Klement
Sent: Tuesday, May 05, 2009 12:44 PM
To: RPG programming on the IBM i / System i
Subject: Re: open ifs file for update

Hi Tim,

Is this a stream file (*STMF) that you are updating? Or... what?
There's no such thing as an "IFS file" but most of the time when people
use that phrase, they really mean a "stream file".

If it is indeed a stream file -- it's important to remember that a
stream file is not organized into records. You can think of the entire
file as one big stream of bytes -- kinda like a character string. Think
of it as one big huge alphanumeric field in RPG.

With that in mind... your question is really "can I change a substring
of this file?"

The answer is YES... Just use lseek() to position to the starting
position where you want to change the substring, and then use write() to
change the data at that position.

But, again, remember that this is NOT a record oriented file. If you
write more bytes than will fit before an existing CRLF (or whatever
delimiter you're using) then you will overwrite the CRLF. They are just
characters in a string...

tim wrote:
I am using ExtProc('write'), ExtProc('open'), etc to create a text file in
the ifs. I was wondering if I can us this type of logic to update an
existing text file. I need to update the first record of the text file
with
summary information.

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.