Problem in updating a IFS file content..

420 pts.
Tags:
AS/400 file specification
IFS
IFS Commands
RPGLE
Hi , i have a text file in IFS which have some data. Now after reading i want to replace all occurance of xyz with abc and update the ifs file .Everything is working fine except updation . The problem is with pointer setting , everytime the data is appended in file rather than replacing ..I am using _C_IFS_fopen,_C_IFS_fgets,_C_IFS_fputs apis.

Please suugest how can i set the pointer to write date to exact position replacing the old one ...



Software/Hardware used:
As400

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    As far as I know, you can't use those APIs to update a streamfile as you want. Usually, streamfiles aren't updated. They are copied and the data is changed during the copy. You can use Unix APIs to cause streamfile updates, but you will find it much easier simply to read from the original file, change the data that you read and write it to a new file. After you finish, you can delete the original and rename the copy. (You might need to set owner and authority on the new file too.) Tom
    125,585 pointsBadges:
    report
  • Yorkshireman
    I routinely handle rtf (text) documents held in the IFS. Were I to do a replace I'd be reading the file, replacing as I go, and writing it back. Mostly courtesy of Scott Klement (thanks Scott) and his open source routines.
    5,580 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following