Merge two Physical Files using Logical File
40 pts.
0
Q:
Merge two Physical Files using Logical File
I have multiple Physical files (Trans2006, Trans2007, Trans2008, etc…) with same record layout with the yearly transactions on my iSeries. I want to merge these files (for temporary period). Is it possible to create a Logical file? If so please help me.
ASKED: Mar 12 2009  10:41 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
24610 pts.
0
A:
 RATE THIS ANSWER
+1
Click to Vote:
  •   1
  •  0
  • AddThis Social Bookmark Button
Yes, that would be what a database system *does* in life.

You could create a simple Access Path as a Logical file - see
DB2 Universal Database for iSeries Database Programming

contains information about the DB2 Universal Database for iSeries (DB2 UDB for iSeries) database management system, and describes how to set up and use a database on IBM ERserver iSeries 400 using traditional system interfaces.

and

Programming DDS for physical and logical files


both of these, and much, much more can be found at




you could also consider copying the two files into a single physical with the CPYF command. use it, then delete it.

//////////////////////////////////////////////
Your logical would look something like this

A* File1
A R FILE1R PFILE(FILE1)
A K FLD1
A K FLD2
A K FLD3
A* File2
A R FILE2R PFILE(FILE1)
A K F2D1
A K F2D2
A K F2D3

Where FILE1R and FILE2R are the record names of the physical files
Fields FLD1-3 are key fields from file1 and F2D1-3 are the corresponding key fields from
file2. You may want to create a differnt record format for one so you can use the RENAME
keyword to rename fields so they have the same field names.

Phil
Last Answered: Mar 13 2009  1:16 PM GMT by Philpl1jb   24610 pts.
Latest Contributors: Yorkshireman   3200 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Nhewage   40 pts.  |   Mar 13 2009  6:40PM GMT

thanks phil. I created a logical.

 
0