5 pts.
 How i can create LF View To More than One Library?
how i can create LF View To More than One Lib.

Software/Hardware used:
iSeries (AS/400) OS/400 V5R2
ASKED: September 1, 2010  7:47 PM
UPDATED: September 2, 2010  1:01 AM

Answer Wiki:
An LF is a view over one or more PF. The LF can be created in any library. What is it you are trying to do? Have a view over a single file or multiple files? If it is multiple, your LF you would need to have some value(s) to JOIN the PFs. You could have multiple formats. If you need a more detailed answer, please let us know exactly what you are trying to accomplish.
Last Wiki Answer Submitted:  September 1, 2010  8:50 pm  by  CharlieBrowne   32,945 pts.
All Answer Wiki Contributors:  CharlieBrowne   32,945 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Are you refering to an SQL view to be used with SQL commands or a native Ligical file which would be used in RPG/COBOL reads.
If its SQL then you would do it with a union statement
As
Create view myview as
Select flda, fldb from lib1/file1
union
Select flda, fldb from lib2/file1

while this can be done in a native lf with multi-formats.
The native LF over multiple libraries can lead to some serious backup and restore issues.
Phil

 44,220 pts.

 

It can be done as a native DDS JOIN LF, a multi-format LF or simply as a normal LF over multiple data members. Or it can be done as a SQL DML VIEW that JOINs or UNIONs multiple underlying TABLEs and/or VIEWs or as a simple cross-product “join”.

There are multiple possibilities with native or SQL methods. The appropriate technique might require seeing a sample of the tables and a description of final result.

Tom

 108,330 pts.