Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / swetha p rao

1. Declare the file File1 in Useropen mode and use OVRDBF
with that library name before you open the file through
QCMDEXC

OVRDBF (LIB1/FIle1) SHARE(*YES)
Open File1
Read File1
.....
Close File1

OVRDBF (LIB2/FIle1) SHARE(*YES)
Open File1
Read File1
.....
Close File1

(or)

Use SQLRPGLE ,Declare a cursor for both files
c+ exec-sql
c+ Declare Cursor C1
c+ Select * from LIB1/File1
c+ End exec

c+ exec-sql
c+ Declare Cursor C2
c+ Select * from LIB2/File1
c+ End exec



Correct me if iam wrong

Is This Answer Correct ?    15 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how do I preserve and clean the array?

1148


How to declare the pull button in AS/400..

2333


what is the necessary keyword needed to scroll subfile records?

1161


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

1307


What is file identifier where we can use?

1131


How to call one program from another program in RPG? please help me with the code

1731


can you debug ile rpg program using isdb?

1267


are there any useful c runtime apis that I can call from rpg iv?

1167


can anybody help me to solve this problem. the program that i m checking display error message saying "Record format for file AJDSPFFD does not match model file and decimal error. how to solve this problem. The AJDSPFFD is snapshot the AJTLOG that is the audit trail list.

2802


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

1193


during execution, an rpg/400 program automatically follows a sequence of operations for each record that is processed. The built-in program cycle includes the following logical steps.

1222


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?

1114


what do you mean by an input subfile, what are the keywords required?

1261


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.

2632


what is the procedure and explain about real time scenario.

1957