300 pts.
 How to copy records from physical to another physical file.
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

Software/Hardware used:
ASKED: September 18, 2012  8:51 AM
UPDATED: September 18, 2012  12:21 PM
  Help
 Approved Answer - Chosen by SURYAP (Question Asker)

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

ANSWERED:  Sep 18, 2012  12:19 AM (GMT)  by SURYAP

 
Other Answers:
Last Wiki Answer Submitted:  September 18, 2012  8:51 am  by  SURYAP   300 pts.
Latest Answer Wiki Contributors:  SURYAP   300 pts.
To see other answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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

 108,270 pts.

 

Whenever my program runs the records in physical should copy to my backup physical file…

 300 pts.

 

…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

 108,270 pts.

 

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

 108,270 pts.

 

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

 

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

 108,270 pts.