Topic
  • 3 replies
  • Latest Post - ‏2011-10-18T07:24:49Z by Taquin
tbullard1
tbullard1
5 Posts

Pinned topic RPG - DB2 PF Question

‏2011-09-05T17:30:33Z |
Working for a new company and there is/was a rule that said all physical files needed to be created without a key - then create what ever LF's with any required key fields. Is there an advantage to this type of design? i.e. - always have your PF with no key? TIA.
Updated on 2011-10-18T07:24:49Z at 2011-10-18T07:24:49Z by Taquin
  • MKENAWI
    MKENAWI
    1 Post

    Re: RPG - DB2 PF Question

    ‏2011-10-14T09:09:35Z  
    The main benfit of this is that when you need to add a new field to the PF you will not need to re-compile all the RPG that uses it (as they will be using a LF that will not hold the new fields), and you will then need to create a new LF -to include the new Fields- and to use this new LF where needed
  • PWConner
    PWConner
    20 Posts

    Re: RPG - DB2 PF Question

    ‏2011-10-14T12:47:52Z  
    • MKENAWI
    • ‏2011-10-14T09:09:35Z
    The main benfit of this is that when you need to add a new field to the PF you will not need to re-compile all the RPG that uses it (as they will be using a LF that will not hold the new fields), and you will then need to create a new LF -to include the new Fields- and to use this new LF where needed
    The advice given pertains to listing all fields in a logical. The question was why not key the physical and place the keys in logical files only.

    I don't know of a good reason not to key the physical. My first guess is whoever created the policy thought non-keyed physicals perform better than keyed physicals. They must have thought the index would always be used when accessing the physical file.

    I'm pretty sure if you want to by-pass a key designed over the physical file you simply leave the K out of the F-spec in a RPG program which will cause the program to read the file based on arrival sequence. So, I'm back to not having a good reason for the non-keyed physical file policy.

    Hopefully, someone more educated than me will chime in.
  • Taquin
    Taquin
    1 Post

    Protect PF

    ‏2011-10-18T07:24:49Z  
    When you have logical files attached to your PF, it is impossible to delete it. You have first to delete all the logical files.

    So with this rule you have at least one logical for each physical and you can't delete the PF by mistake.

    Vincent