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

15 pts.
Tags:
DB2
Logical File
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

 * RECORD FORMAT NAME
A R F$MACNEILR PFILE(F$MACNEILC)
* KEY FIELDS
A K PARTNO
 
Now at a command line key the command to create a logical file. CRTLF
PRESS F4
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: 4  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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • 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.

     

    49,435 pointsBadges:
    report
  • 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

    CREATE ALIAS MYLIB/MYALIAS1 FOR MYLIB/MYPHYSICAL (MYMEMBER)

    49,435 pointsBadges:
    report
  • philpl1jb

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

    49,435 pointsBadges:
    report
  • BigKat
    The best solution might be to just ask the IT folks that normally work on it to set up the logical for you. 
    7,845 pointsBadges:
    report

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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

Following