I have a Physical File name 'File1', which is present in
two libraries named 'LIB1' & 'LIB2'. These 2 libraries are
listed in the library list. Would like to access data from
this file from these two libraries using RPG program. How
to do this, any idea?
Answer Posted / divakar reddy
F FILE1 IF A E K DISK ExtFile('LIB1/FILE1')
RENAME(file1:Afile1)
F FILE1 IF A E K DISK ExtFile('LIB2/FILE1')
RENAME(file1:Bfile1)
This should work...
Is This Answer Correct ? | 9 Yes | 1 No |
Post New Answer View All Answers
What is the difference between copybooks and subprocedures in as400?
How to create a login screen using a command instead of display file.... intention is to get a password field on a command..... how do you achieve this...
What is file identifier where we can use?
How to handle duplicate error handling in RPG?
Please tell me how to read the records from a file with load an array of size with error conditions(The logic answer for this question is ARR is array of 99 elements Z-ADD 0 IDX *LOVAL SETLL FILE READ FILE 99 *IN99 DOWEQ *OFF IDX ANDLT 99 ADD 1 IDX MOVE FIELD ARR,IDX READ FILE 99 ENDDO).So,Please give me the complete of this code.
how do I declare a table or array in rpg iv?
How to call one program from another program in RPG? please help me with the code
which program rpg or cl is efficent to update a transaction onto a database file and why ?
How many program bind in one module....
1. What is bound-by-call and bound-by-reference? 2. Where and why is *Nomain used? 3. What are the difficulties faced by programmers when using service programs? 4. Explain the different ways of parsing and compiling XML in iSeries.
Interviewer asked me write down DDS for load all subfile .can anybody write dds
Hi Viewers can any body explain me how to update and ahange the already existed data in physical file using subfile ? please explain me with the code if possible?
write an RPG program to calculate the marks of 5 students (A,B, C, D, E)in 3 different subjects (eng, math, sci) an display on the screen
Explain mdt?
is this a rpg channel?