On 24-Sep-2015 13:36 -0600, Vernon Hamberg wrote:
Just ran into some keyed source PFs on our system - not all, just
some (probably) older ones.
So I've never even considered the possibility - is or was there a
reason for this?
Anyone more geezerish than I who remembers? Or knows?
Because that is supported :-) Supported, both in a DDS-described PF-SRC or a LF-SRC. Or more conveniently [without having to code the DDS source], a parameter is available on the Create Source Physical File (CRTSRCPF), the Access Path Type (ACCPTH). The default for that parameter is *ARRIVAL but the parameter specification of *KEYED is supported; the effect is to assign the Source Sequence (SRCSEQ) field as the one key of a non-unique keyed access path.
I have used that feature, almost exclusively, to allow for adding rows sequentially to the end but to appear positionally [by key] wherever they are necessary and for modifying rows to reposition the data [thus also Allow Delete (ALWDLT) and Allow Update (ALWUPD) also set to *YES]. Thus for a DDS-PF source, I can insert a row to add a new field between others by specifying an appropriate sequence number, or I can change the order of the rows and thus the order of the fields within the RcdFmt simply by modifying the sequence numbers, rather than by physically modifying the rows or deleting and then re-inserting rows of the source.