Quick and easy solution with embedded SQL:

DCL-S FromIFSFile SQLTYPE(CLOB_File);
DCL-S ToIFSFile SQLTYPE(CLOB_File);
/--------------------------------------------------------------------------------------------------------
FromIFSFile_Name = '/home/YourDir/MyIFSFile.txt';
FromIFSFile_NL = %Len(%Trim(FromIFSFile_Name));
FromIFSFile_FO = SQFRD; //Read Only

ToIFSFile_Name = '/home/YourDir/MyIFSFile.txt';
ToIFSFile_NL = %Len(%Trim(ToIFSFile_Name));
ToIFSFile_FO = SQFOVR; //Replace
Exec SQL Set :ToIFSFile = Replace(:FromIFSFile, 'FromValue', 'ToWhatever');
//Handle SQLCODE

*InLR = *On;

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them and keeping them!"
„Train people well enough so they can leave, treat them well enough so they don't want to.“ (Richard Branson)


-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of gio.cot via RPG400-L
Sent: Dienstag, 15. Januar 2019 13:23
To: rpg400-l@xxxxxxxxxxxx
Cc: gio.cot <gio.cot@xxxxxxxxxxx>
Subject: Replace character in a IFS file

Hi all

I'm looking an example (possible in RPG) that replace some character with other (that i want) inside an Ifs file

Thanks in advance

Gio



---
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
https://www.avast.com/antivirus
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com


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