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



we have 2 PF files with same name, how to copy data's from one file to another through RPG pr..

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 ?    18 Yes 1 No

we have 2 PF files with same name, how to copy data's from one file to another through RPG pr..

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

we have 2 PF files with same name, how to copy data's from one file to another through RPG pr..

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

Post New Answer

More IBM AS400 AllOther Interview Questions

what is the purpose of dynslt keyword?

1 Answers   IBM,


What is the maximum number of elements in an array?

1 Answers  


define the purpose of the *cat function?

1 Answers   IBM,


how can you specify no duplicate key?

0 Answers   IBM,


what does the ovrdbf command do?

0 Answers   IBM,






How can we find from which source the program has been compiled for a given RPGLE program object?

5 Answers  


how to get the particular field's records in CL without using OVRDBF,OPNQRY? tell me the concept?

2 Answers  


how to get the cursor position?

0 Answers   IBM,


What are the mandatory keywords of sub file?

0 Answers   IBM,


define the purpose of the iter operation?

1 Answers   IBM,


what is the difference between normal upddta to pf and updating using dfu program?

0 Answers   IBM,


what is a composite key?

1 Answers   IBM,


Categories