PxPlus User Forum

Main Board => Discussions => Language => Topic started by: Ken Sproul on July 21, 2025, 06:01:55 PM

Title: Key Segment Location Requirement for Extended Record Sizes
Post by: Ken Sproul on July 21, 2025, 06:01:55 PM
I know there's a requirement for where the data for key segments must be found in an extended record file. In other words, a key segment will not find the referenced data beyond a certain number of bytes in the record. I need to know what that number is. I think it might be 31000, but I couldn't find it in the documentation.
Title: Re: Key Segment Location Requirement for Extended Record Sizes
Post by: Devon Austen on July 22, 2025, 12:19:46 PM
The limit for the key segment offset is 3839 - segment length.

KEYED "keyoffsettest","[1:1:6],[2:3830:10]",0,-31000,OPT="X"

or

KEYED "keyoffsettest","[1:1:6],[2:3830:10]",0,-31000,OPT="X"
Title: Re: Key Segment Location Requirement for Extended Record Sizes
Post by: Ken Sproul on July 22, 2025, 07:01:30 PM
Hi Devon,

What I meant was this:
I have a file with an extended record size up to 2gb.
I want to create an alternate key that consists of field #25 with a length of 10 that is physically located somewhere near the end of the record, say 1.5gb ([25:1:10]).
Will the data for the key be found there, or does it have to be physically located within the first X number of bytes in the record?
Title: Re: Key Segment Location Requirement for Extended Record Sizes
Post by: Devon Austen on July 23, 2025, 04:49:54 PM
In that cause you were bang on with your initial guess.

PxPlus can't read beyond the non-extended record portion for keys. So whatever your max record size is will be the limit. So if your max record size is 31000 then data beyond 31000 bytes in the extended record cannot be part of the key.