SORT Engine Environment Variables

This topic lists environment variables that relate to the sorting functionality.

MFJSDCBOUTFIL
Determines whether the DCB's LRECL value is honored during an OUTFIL statement.
MFJSDCBOUTFIL={ON|OFF}
Parameters
ON
The LRECL specified in the DCB properties is used during an OUTFIL statement.
OFF
Emulates the ICE222A/ICE217A mainframe restriction.
Default
MFJSDCBOUTFIL=OFF
Comments
When MFJSDCBOUTFIL=ON is in effect, if the DCB LRECL value differs from that calculated by OUTFIL, records are either truncated or padded with space to match the DCB LRECL value.
Example
MFJSDCBOUTFIL=ON
MFJSTATS

For a COBOL sort not running under mainframe emulation, setting the environment variable MFJSTATS to ON creates a report containing statistics for the SORT that is displayed to SYSOUT. If a report file already exists for a previous SORT, the new statistics are appended to the end of the previous one.

If you are performing a COBOL sort using mainframe emulation, you can create a statistics report by modifying the JCL statement.

Syntax

SET MFJSTATS=switch

Parameters

switch Switches report creation ON or OFF. The default is OFF.

SORTCOMPRESS
Tells the system whether or not to execute a compression routine on each record to be sorted.

Syntax

SET SORTCOMPRESS=n

Parameters

n - An integer that indicates if compression is enabled or not. 0 (zero, the default) indicates not enabled; any positive integer indicates enabled. When enabled, it allows for run-length encoding of sort records, resulting in much better performance when records contain multiple repeated characters.

Comments

This variable is recommended if the sort records contain many single repeated characters, for example, multiple spaces, as it can be very effective in improving memory usage and therefore sort performance.

Example

SET SORTCOMPRESS=5
SORTSCHEME
Activates a sortscheme. Use in conjunction with SORTSPACE for improved performance.

Syntax

SET SORTSCHEME=1
Values
  • SORTSCHEME=1 - this is the only valid value for the environment variable. See SORTSPACE for more information.
SORTSPACE
The amount of memory to be allocated to internal workspace for SORT operations. This can be specified in different formats: for example, you could specify 64M, 2G, and 1000000 to give sort memory areas of 64 Megabytes, 2 Gigabytes and 1000000 bytes respectively.

Syntax

SET SORTSPACE=n[K|k|M|m|G|g]

Parameters

n[K|k|M|m|G|g The amount of memory to be allocated to internal workspace for SORT operations. K or k indicates kilobytes, M or m indicates megabytes and G or g indicates gigabytes. No letter indicates bytes. Defaults to 1 megabyte.

Comments

A larger value for SORTSPACE will generally result in a faster sort. However, if you specify a value that exceeds the capacity of main memory in your computer, such that the operating system has to page memory in and out, performance will be degraded.

Example

SET SORTSPACE=1024K

SORTTEMPSPACE
Specifies the amount of memory to be allocated to temporary workspace for SORT operations.

Syntax

SET SORTTEMPSPACE=n[K|k|M|m|G|g]

Parameters

n[K|k|M|m|G|g] The amount of memory to be allocated to temporary workspace for SORT operations. K or k indicates kilobytes, M or m indicates megabytes and G or g indicates gigabytes. No letter indicates bytes. 32 megabytes is the lowest amount of memory that can be allocated.

Comments

The memory allocation strategy used by SORT can be adjusted through use of SORTTEMPSPACE, which generally improves performance in systems suffering from memory fragmentation.

Example

SET SORTTEMPSPACE=250MB
SORTTYPE
Defines the sort type.

Syntax

SET SORTTYPE=2
Values
  • SORTTYPE=2 Forces SORT to use the file handler, so that format modifications are picked up from the extfh.cfg file.
  • Not setting this variable means that SORT will try to use CBL_ routines to read and write files to improve performance.
Note: 2 is the only valid value for this environment variable.