开云体育

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

SORT, REGION and MAIN


 

How do the values of REGION JCL paramater and the SORT parameter MAIN relate to one another.
?
I suspect that REGION might need to be a bit larger than MAIN, but I cannot find any specific explanation.
?
I'm playing around with a SORT of 99,999,999 randomly generated records.? To get things work, I set the REGION to 2048K and MAIN to 1984K.? The SORT works, but I'd like to be able to come up with the required values more scientifically.
?
Running TK5/Update 3


 

Can run with REGION=6M possibly larger. End of step message shows how
much memory of 24, 31, 64 bit memory was actually used.

On Tue, Nov 19, 2024 at 1:59?PM Daniel L. Srebnick via groups.io
<dan@...> wrote:

How do the values of REGION JCL paramater and the SORT parameter MAIN relate to one another.

I suspect that REGION might need to be a bit larger than MAIN, but I cannot find any specific explanation.

I'm playing around with a SORT of 99,999,999 randomly generated records. To get things work, I set the REGION to 2048K and MAIN to 1984K. The SORT works, but I'd like to be able to come up with the required values more scientifically.

Running TK5/Update 3


--
Mike A Schwab, Springfield IL USA
Where do Forest Rangers go to get away from it all?


 

Hi Daniel,

For a successful sort the REGION size definitely has to be larger than the storage that the S/M Program is allocated by use of various S/M Program parameters. As to how much larger the REGION size has to be is dependent on how the S/M Program is invoked, JCL with or without user exits, or by another program. Assuming the simplest case of invoking the S/M Program via JCL and no user exits I would suggest that the REGION size should be at least 128K larger than the storage allocated to the S/M Program to avoid any out of storage issues.

The S/M Program has many configuration options and parameters provided to limit its storage usage. Constraining S/M Program storage usage is not so much of an issue in the Hercules environment however in a production environment it is an important consideration.

The Sort/Merge Program has poor locality of reference when running in a virtual storage system. This is because the Sort/Merge Program functions by moving records from input buffers to the Record Storage Area and then selects, using multiple compare instructions, the next record to be moved out to one of the output buffers. The impact of this logic is that the contents of the RSA and all the I/O buffers are referenced constantly during a sorting operation. Allocating 1024 KB of storage to the Sort/Merge Program will result in the need for a working set of at least 256 pages to avoid paging overhead. Allocating additional storage to the Sort/Merge Program above what is needed for optimum performance will result in an increased number of pages required for the working set.

The OS/360 Sort/Merge for MVS 3.8 Installation, Customization and Diagnosis Guide provides a detailed discussion on controlling S/M Program storage allocation and performance characteristics.

Regards

Tom