Record addition in a PF

1,150 pts.
Tags:
Physical File
RPG
RPG/400
I have a PF with some data in it which i am using in a RPG program. I got another text file with extra data related to PF in it. I have to add this data to the existing data in the PF, Please tell me how can i do this from my RPG program....advance thanks
ASKED: January 3, 2009  6:15 PM
UPDATED: January 5, 2009  3:24 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

I feel like I’m missing most of the spec on this one.

Here’s a totally blind shot assuming that the flat file contains key info and change info for the dbms file
If it’s going to change records in the existing file …
1. Read each record in the flat file
2. for each record in the flat file
get the matching record in the physical file
write a record to the audit log or printer file – to record the change or failure to find the record
update the fields as required
update the physical file.

if it’s going to add records to the existing file
1. Read each record in the flat file
2. for each record in the flat file
write a record to the audit log or printer file – to record the change or failure to find the record
update the fields as required
update the physical file.

Phil

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
  • ten2008
    HI Phil, thanks for ur response. But what i got in addition is only a simple text document thru mail. I need to embed this data to existing PF. Sorry for making this ambiguous... Ram
    1,150 pointsBadges:
    report
  • philpl1jb
    You're need to get this in a flat file on the 400 Then create an RPG program which reads each record from the flat file -- applies a data structure or uses the %subst function to extract the fields from the file -- finds the correct record in the dbms PF if one exists and update it. or -- writes a new record to the dems PF
    48,575 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