we have 2 PF files with same name, how to copy data's from
one file to another through RPG program logic?
Answers were Sorted based on User's Feedback
Answer / venkat b
You can give 2 different names to the different Physical
Files like the following code and then use the
keyword "EXTFILE" to give a fully qualified PF -
Fname1 if f 10 disk extfile(LIBRARY1/filename)
Fname2 if f 10 disk extfile(LIBRARY2/filename)
RENAME(rcdname1:rcdname2)
Then, use DOW, Read and write.
| Is This Answer Correct ? | 19 Yes | 1 No |
Answer / syam
You can't declare 2 pf in the RPG program with same name.
If you declare, system will give error on compilation
(*RNF2026 30).
You can rename same record name in RPG program.
You can rename fiel name in RPG program.
You can't keep 2 pf in one library with same.
2 pf with same name in 2 differned library, you can copy
to 1 pf thru CPYF cl command.
| Is This Answer Correct ? | 17 Yes | 5 No |
Answer / perumal
Declare the 2 PF files in the RPG program. Rename either
one of the file record format in F Spec
If the fields also same use PREFIX Keyword uisng D spec if
you are using ILE
Or RPG/400 use I spec and rename the fields
Then read from the file and write into the another file
| Is This Answer Correct ? | 9 Yes | 9 No |
records can be read/update/deleted with which file?
What is a Join Logical File, Can it be used for Update ?
How can we arrange duplicate records in a file?
What is an Array Data Structure?
Q.1.What is differences in STRDBG and STRISDB debugging commands? 2.Where we should use STRDBG and STRISDB Debugging commands?
how do you use commitment control in rpg program ?
How do you put jobs in batch mode?
How can we update a specific field in RPG?
List and explain the different type of data structures?
How to declare the length of emp no in the physilcal file and the mandatory length is 6 i.e. Emp No should be numeric, mandatory and fill all the 6 places
i want to display the 10000 record in a subfile by using loadall , can we do it?
How to convert a spool file to PDF file in AS400?