PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Howto INCREASE External Key Size on DIRECT/KEYED files  (Read 424 times)

nmartinez@bristolind.com

  • Silver Member
  • ***
  • Posts: 31
    • View Profile
Howto INCREASE External Key Size on DIRECT/KEYED files
« 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!

Ken Sproul

  • Gold Member
  • ****
  • Posts: 57
    • View Profile
Re: Howto INCREASE External Key Size on DIRECT/KEYED files
« Reply #1 on: May 09, 2023, 01:53:21 PM »
To my knowledge there is no way to increase the key size of a direct file.
Ken Sproul
DPI Information Service, Inc.
Pivotal Systems LLC

nmartinez@bristolind.com

  • Silver Member
  • ***
  • Posts: 31
    • View Profile
Re: Howto INCREASE External Key Size on DIRECT/KEYED files
« Reply #2 on: May 09, 2023, 11:15:57 PM »
Thank you, Ken!

Mike Hatfield

  • Gold Member
  • ****
  • Posts: 70
    • View Profile
Re: Howto INCREASE External Key Size on DIRECT/KEYED files
« Reply #3 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  :-\
Mike H

nmartinez@bristolind.com

  • Silver Member
  • ***
  • Posts: 31
    • View Profile
Re: Howto INCREASE External Key Size on DIRECT/KEYED files
« Reply #4 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..

James Zukowski

  • Diamond Member
  • *****
  • Posts: 275
    • View Profile
Re: Howto INCREASE External Key Size on DIRECT/KEYED files
« Reply #5 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.
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services

nmartinez@bristolind.com

  • Silver Member
  • ***
  • Posts: 31
    • View Profile
Re: Howto INCREASE External Key Size on DIRECT/KEYED files
« Reply #6 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.