PxPlus User Forum

Twitter Twitter Twitter

Author Topic: SORT file  (Read 845 times)

Gilles

  • Silver Member
  • ***
  • Posts: 27
    • View Profile
SORT file
« on: March 04, 2021, 08:15:19 AM »
Is there a way to have a sort file with size greater than 8 GB ?
We got an error 16 at this point.

PRINT FIN(CHAN,"FILE_CREATE")
SORT "/usr4/gg",32,SEP=$0A$
PRINT PRM('KF')
2

jasonc

  • Silver Member
  • ***
  • Posts: 22
    • View Profile
Re: SORT file
« Reply #1 on: March 04, 2021, 01:39:46 PM »
While I don't know the answer to your specific question, have you considered just using a normal file and just writing without a record/iolist?  I believe your write syntax will be the same as you are using now to write to your SORT file  You will need to use a bigger block size to exceed 8 GB.  Since you are using EFF files, this should allow it to grow to 64 GB:
CREATE TABLE "/usr4/gg",32,BSZ=8,SEP=$0A$

Gilles

  • Silver Member
  • ***
  • Posts: 27
    • View Profile
Re: SORT file
« Reply #2 on: March 04, 2021, 03:28:17 PM »
We tried this but there is a problem with the BSZ:

CREATE TABLE "/usr4/gg4",32,BSZ=8,SEP=$0A$
open(1)"/usr4/gg4
?fin(1,"file_create")
KEYED "/usr4/gg4",32,0,-1,BSZ=4,OPT="2",SEP=$0A$

CREATE TABLE "/usr4/gg4",32,BSZ=16,SEP=$0A$
open(1)"/usr4/gg4
?fin(1,"file_create")
KEYED "/usr4/gg4",32,0,-1,BSZ=4,OPT="2",SEP=$0A$

CREATE TABLE "/usr4/gg4",32,BSZ=20,SEP=$0A$
open(1)"/usr4/gg4
?fin(1,"file_create")
KEYED "/usr4/gg4",32,0,-1,BSZ=4,OPT="2",SEP=$0A$

Regardless of the BSZ specified on the CREATE TABLE directive, the result is BSZ=4, so 8 GB file size limit

The only solution to have a file who looks like a sort with a BSZ as you want  (and a record lenght to 1 !!) :

CREATE TABLE "/usr4/gg4",32,0,1,BSZ=16,SEP=$0A$
open(1)"/usr4/gg4
?fin(1,"file_create")
KEYED "/usr4/gg4",32,0,-1,BSZ=16,OPT="2",SEP=$0A$

If you don't specify the record lenght the BSZ is always 4, if you specify the record lenght to 0 it is alaways 256.
We have to specify a record lenght to 1 to have the BSZ to what you want, this is not a real SORT file (record lenght = 0)