Getting the Longest Length from only the Primary file does NOT look like the fix for a Browse.
The Browse uses ViewPosition = POSITION(View)
and not just POSITION(Primary)
. According to the Help on POSITION(View) the Position String includes all Secondary File Keys i.e. Join(, Secondary File Key). So you need to walk the View files and add the length of those keys.
The help hints that the Position is driver specific (aka “underlying file system”) it’s not documented. I wonder if the Position requires both Order By key position fields for sequence … and … primary key fields. Maybe a Trace would show something.
VIEW usage
The return string for POSITION(view) contains all the information required by the underlying file system to reset to the one specific position within the record set currently in the VIEW. It also contains the file system’s POSITION return value for the primary file key and all secondary file linking keys. This allows POSITION(view) to accurately define a position for all related records in the VIEW.