PxPlus User Forum

Main Board => Discussions => Programming => Topic started by: nmartinez@bristolind.com on May 09, 2023, 11:38:19 AM

Title: Howto INCREASE External Key Size on DIRECT/KEYED files
Post by: nmartinez@bristolind.com on May 09, 2023, 11:38:19 AM
Hi all,
Is there an easy way to increase the external key size on a direct/keyed file?  This file has only one external key.
In the screenshot below, the external key size is 20, how do we go about increasing this to 30, without having to create a new direct file and then copy records from current file.
Thank you!
Title: Re: Howto INCREASE External Key Size on DIRECT/KEYED files
Post by: Ken Sproul on May 09, 2023, 01:53:21 PM
To my knowledge there is no way to increase the key size of a direct file.
Title: Re: Howto INCREASE External Key Size on DIRECT/KEYED files
Post by: nmartinez@bristolind.com on May 09, 2023, 11:15:57 PM
Thank you, Ken!
Title: Re: Howto INCREASE External Key Size on DIRECT/KEYED files
Post by: Mike Hatfield on May 09, 2023, 11:35:47 PM
Many moons ago in the days before self-expanding files we wrote a utility program to change key size, change record length and the number of records in the file. I think I was a lot younger then  :-\
Title: Re: Howto INCREASE External Key Size on DIRECT/KEYED files
Post by: nmartinez@bristolind.com on May 10, 2023, 11:36:53 AM
Thank you, Mike!
Thought that PVXPlus may have a utitlity to do this and expand the external primary key, etc..
Title: Re: Howto INCREASE External Key Size on DIRECT/KEYED files
Post by: James Zukowski on May 10, 2023, 12:29:41 PM
The text-based utility that exists in PxPlus will copy from one file to another with the option to "restructure" it in the process. From command level, you can:
call "*U" -> F -> C
Follow the prompts, and you should be able to figure it out. You'll need to copy to a new file name and then do some renaming afterwards.
Title: Re: Howto INCREASE External Key Size on DIRECT/KEYED files
Post by: nmartinez@bristolind.com on May 11, 2023, 11:01:43 AM
Thank you, James!. 
We have already created a program to help us do this.  We just did not want to re-invent the wheel.