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 Post
Re: RPG - DB2 PF Question2011-10-14T09:09:35ZThis is the accepted answer. This is the accepted answer.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 100000AD5C20 Posts
Re: RPG - DB2 PF Question2011-10-14T12:47:52ZThis is the accepted answer. This is the accepted answer.
- MKENAWI 270004PTDX
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 Post
Protect PF2011-10-18T07:24:49ZThis is the accepted answer. This is the accepted answer.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.