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 / syam

In RPG use this
F FILE1 IF A E K DISK RENAME(file1:Afile1)
F FILE1 IF A E K DISK RENAME(file1:Bfile1)

In read, open and close use Afile1 and Bfile1

Is This Answer Correct ?    2 Yes 18 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how do I declare a table or array in rpg iv?

728


What is the purpose of record level identifier?

722


How many program bind in one module....

2113


What is ment by record level identifier?

645


How to select highest score of each subject or how to select highest income of every month?

1286






what happens when sflsiz = sflpag? What are the advantages and disadvantages?

706


what was the robotech rpg?

678


If my rpg program has a date field, what extra care I have to take while compiling that rpg program? If the file is keyed and I have declared the file as well as key list properly in my program. Still am getting an error message like "chain/reade operation is not allowed" what may be the case?

609


how do I declare a minor?

707


give an eg of ACQ-(ACQUIRE),BIT OFF,BIT ON,DEALLOC,DUMP,FEOD,FORCE,MHHZO,MHLZO,MHLLZO,MLHZO,REL,RESET,TESTZ,TESTB,TESTN----GIVE SMALL EXAMPLE TO THE OPCODES...TO UNDERSTAND FUNCTIONING...........

3268


Assume 2 users are using the same file and first user updates some record in the file. Will the 2nd user will be able to see the updated record or not?

508


how can I tell when to replace the array?

692


1. If there are two programs using same file and 2 users are using the file at the same time and what can be done to allow them both to access? 2. How can remove lock from the file for accessing it by both users?

478


if there is a module object , how to find the program object for this module object.Assume the module object name and program object name is not same.

2187


do you use message subfiles? What are the necessary keywords required coding a message subfile?

681