How to copy records from physical to another physical file.

300 pts.
Tags:
Physical File
RPG
Hi, I have a question when i seen my requirement. I have two physical files and one RPG program. What I need is, I want to write RPG code for " Copy updated records from one physical file to another physical file" . (Another physical file is for Backup Purpose. ) Regards Surya P

Answer Wiki

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

IN CL :  CPYF
IN SQL : USE INSERT
IN  RPG : READ THE FIRST PF AND WRITE IN BACKUP PF

Discuss This Question: 6  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
    Copy updated records from one physical file to another physical file   How does your program know the records were updated? Does it also perform the UPDATE?   Tom
    125,585 pointsBadges:
    report
  • SURYAP
    Whenever my program runs the records in physical should copy to my backup physical file...
    300 pointsBadges:
    report
  • TomLiotta
    ...the records in physical should copy to my backup...   We already know that. But what we don't know is: How does your program know the records were updated? Does it also perform the UPDATE?   Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    How does your program know which records to copy? Does it copy every record? If it does, why don't you run the CPYF command instead?   Or does it only copy some records? If it does, how does know which records to copy? If it can recognize the correct records, why not just use the CPYF command instead? Why do you need an RPG program?   If RPG is needed, then there must be more to the problem. What else is needed to know?   Tom
    125,585 pointsBadges:
    report
  • SURYAP
    No need check for update or anything else..Only i need to copy the records from "PF"(physical file) to "Backuppf"(backup physical file).What command i have to use...
    300 pointsBadges:
    report
  • TomLiotta
    Personally, I wouldn't copy the records at all. I would journal the file and simply use the journal if recovery is needed. Of course, regular saves (backup operations) of the file and of the journal receivers would be done. -- Tom
    125,585 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