开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Cobol with sort


 

In an external sort it reads and writes the records. >Then a batch reads again teh the records and writes them again.
With a cobol and the internal sort the cobol reads the records gives to sort (memory to memory) and sort gives back the records (memory to memory) and the cobol writes the records.
So with internal sort we have half of i/os so we should be quicker than external sort. So Why external sort is quicker ? Is the internal sort so badly written or do i forgot something ?

搁别苍é


 

Both the internal and external sort use the same sort software.? Factors such a region size, number of sort work files, estimated record counts, etc determine sort speed.? In addition, COBOL internal sort uses defaults optimized for small regions (64k in the case of MVT COBOL).? The sort utility standalone will use all available memory in the region. Internal sorts are constrained because they must share the region with the COBOL program.


 

With internal sort we can have only the used part of the record in the output section, so it should be more records in memory, but with that the external sort is quicker.
So i think that each time the cobol insert a record the sort program redoes a lot of things (for me not needed)...
I will put the programs, jcls and data.

搁别苍é


Le mardi 16 avril 2024 à 15:35:59 UTC+2, Ed Liss <egliss4024@...> a écrit :


Both the internal and external sort use the same sort software.? Factors such a region size, number of sort work files, estimated record counts, etc determine sort speed.? In addition, COBOL internal sort uses defaults optimized for small regions (64k in the case of MVT COBOL).? The sort utility standalone will use all available memory in the region. Internal sorts are constrained because they must share the region with the COBOL program.


 

here is the file with all inside

搁别苍é


 

I see that this was run on a Z/OS system using something other than MVT COBOL (COBOL 2?).? BUT I would refer you to a COBOL manual for the compiler you are using as well as a DFSORT manual to find out about the defaults for the memory, sort techniques and COBOL special registers related to internal sorts.

Bottom line for sorting comes down to "less memory means more i/o.? more memory means less i/o.".??


 

"less memory means more i/o. more memory means less i/o."
With internal sort i give only 27 bytes so in memory it puts a lot more than the external where it use 80 bytes per records
I think the insert into the sort does each time a lot of work like if it initializes again some things

Is it a way to see what it does ?

Many thanks,
搁别苍é


Le mercredi 17 avril 2024 à 21:55:45 UTC+2, Ed Liss <egliss4024@...> a écrit :


I see that this was run on a Z/OS system using something other than MVT COBOL (COBOL 2?).? BUT I would refer you to a COBOL manual for the compiler you are using as well as a DFSORT manual to find out about the defaults for the memory, sort techniques and COBOL special registers related to internal sorts.

Bottom line for sorting comes down to "less memory means more i/o.? more memory means less i/o.".??


 

I use 5655-G53 IBM Enterprise COBOL for z/OS and OS/390 3.1.1

搁别苍é


Le mercredi 17 avril 2024 à 22:07:20 UTC+2, Rene BRANDT via groups.io <rbr146@...> a écrit :


"less memory means more i/o. more memory means less i/o."
With internal sort i give only 27 bytes so in memory it puts a lot more than the external where it use 80 bytes per records
I think the insert into the sort does each time a lot of work like if it initializes again some things

Is it a way to see what it does ?

Many thanks,
搁别苍é


Le mercredi 17 avril 2024 à 21:55:45 UTC+2, Ed Liss <egliss4024@...> a écrit :


I see that this was run on a Z/OS system using something other than MVT COBOL (COBOL 2?).? BUT I would refer you to a COBOL manual for the compiler you are using as well as a DFSORT manual to find out about the defaults for the memory, sort techniques and COBOL special registers related to internal sorts.

Bottom line for sorting comes down to "less memory means more i/o.? more memory means less i/o.".??