NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
This topic has been locked.
3 replies Latest Post - 2011-10-18T07:24:49Z by Taquin
Pinned topic RPG - DB2 PF Question
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
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 270004PTDX1 PostACCEPTED ANSWER
Re: RPG - DB2 PF Question2011-10-14T09:09:35Z in response to tbullard1The 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 100000AD5C20 PostsACCEPTED ANSWER
Re: RPG - DB2 PF Question2011-10-14T12:47:52Z in response to MKENAWIThe 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 270004Q5881 PostACCEPTED ANSWER
Protect PF2011-10-18T07:24:49Z in response to tbullard1When 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.