iSeries DB2 – Have Physical File need to create Logical File to access Member

15 pts.
Logical Files
Physical File
I know very little about the iSeries (I can spell it is all). I am working with an ODBC connection to get to DB2 data on the iSeries. Everything is going extremely well other than 2 files that I need to access use members. These are the only ones that do on the entire system. I was told that I could create a Logical File to overlay the Physical File to access four of the seven members. First question, is do I need four separate logical files or will one work? (either way would work for me). Second question is how do I do this?  I have tried reading papers and most talk about using a source file. This does not exist on the system. I need good instructions that are easy to follow with no assumptions that I have a clue what I am doing.

Software/Hardware used:
AS400 iSeries DB2

Answer Wiki

Thanks. We'll let you know when a new response is added.

First create a source member that has the requirements for the LF. Fields used, select requirements, key fields..

Here is a sample of source for a LF called F$MACNEILC. This is stored in a QDDSSRC member with the same name as the file. The file uses all the fields from the PF, no selection of specific records, and is keyed by PARTNO

Now at a command line key the command to create a logical file. CRTLF
Enter your new file name, and the library where you want to store the file. Usually the same place as the PF. 
Enter the Source file and library (You just created this). If the member name is different, enter it, else you can leave it at *FILE
At the bottom of the screen, enter the name and library of the PF.
Put a + sign on the next line for Members. Press enter.
You now have a page where you can enter all the members names you need.
Press enter and you will create the file.                                    

Discuss This Question: 5  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • philpl1jb

    A          R F$MACNEILR                PFILE(F$MACNEILC)<BR>

    F$MACNEILR  Must be the physical file Format name.

    Not something you probably work with .. getit from here

    dspfd myPhysicFile

    Go to the bottom of ther file

    The word "Format" will be in the upper left

    The Format name is just below that.

    54,090 pointsBadges:
  • philpl1jb

    A simplier alternative would be to use SQL to create an Alais for each member and then use the Alais instead of the physical or logical

    SQL command


    54,090 pointsBadges:
  • philpl1jb

    The Alais will only work if you use SQL to access the data.

    54,090 pointsBadges:
  • BigKat
    The best solution might be to just ask the IT folks that normally work on it to set up the logical for you. 
    9,460 pointsBadges:
  • Genderhayes
    I have no idea of what connection URL you are using the db2 protocol for example if you are connecting through JDBC ODBC read others more detailed Sorry
    10,730 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: