Can someone help me I can't remember how to check if a logical shares the same access path as another.
Can someone help me I can't remember how to check if a logical shares the same access path as another.
Tony, I don't know of a system command that allows this. I use the DSPFD on the logical to identify the key field(s). I guess you could change the output to OUTPUT(*OUTFILE) and use Query to review the data it generates. -bret
Tony, You use DSPDBR on the physical file to list out all the it's logicals. Then use DSPFD TYPE(*ACCPTH) to see their individual keys. I have a utility for this purpose. Just ask if you need it. Don't worry, it's free. Just need some digging to find the source (cuz it is sooooo old).
It's not enough to simply list out the keys used. Establishing access path sharing requires you to create the logicals in the correct order. Suppose your logical A has a key of BRANCH and logical B has BRANCH/EMPL. As long as all the records for the same BRANCH are grouped together logical A doesn't care what order the EMPLs come in. Logical B does. So if you create logical A first, logical B cannot share the access path. However if you create logical B first, logical A is quite happy to share it - it doesn't care about the higher level of organisation with BRANCH: it's irrelevant to it. To check whether the access paths are actually shared, list the logicals as Tony says, then do DSPFD using the default TYPE(*ALL) - not TYPE(*ACCPTH) - and scan for the string "Implicit access path sharing". If the value is "Yes" the access path is shared; if it's "no" then it isn't. If it's shared it also tells you the name of the file that owns the access path. Deleting the logical that owns the access path will not delete the access path itself; ownership will transfer to another file that shares it. As long as the keys haven't changed, recreating the original owner should allow the sharing to resume although ownership will not transfer back. HTH Dave...