I really like that! Can it handle hex values?



-----Original Message-----
From: Birgitta Hauser [mailto:Hauser@xxxxxxxxxxxxxxx]
Sent: Wednesday, January 16, 2019 12:18 AM
To: 'RPG programming on the IBM i (AS/400 and iSeries)' <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: RE: Replace character in a IFS file

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)



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