SORT Engine Environment Variables

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

MFJSENGINE

Specifies which sort engine the utility MFJSORT is to emulate.
Syntax
MFJSENGINE={DFSORT|SYNCSORT}
Parameters
DFSORT
MFJFSORT emulates the mainframe DSORT utility.
SYNCSORT
MFJFSORT emulates the SYNCSORT utility.
Default
MFJSENGINE=DFSORT

MFJSDCBOUTFIL

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, determines whether statistics are included in reports produced for the COBOL SORT operation.
Syntax
MFJSTATS={ON|OFF|switch}
Parameters
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.
OFF
No statistics are included in the report.
switch
Switches the inclusion of statistics in the report to ON when set to OFF, and to OFF when set to ON.
Default
MFJSTATS=OFF
Comments
If you are performing a COBOL sort using mainframe emulation, you can create a statistics report by modifying the JCL statement.

SORTCOMPRESS

Tells the system whether or not to execute a compression routine on each record to be sorted.
Syntax
SORTCOMPRESS={0|1}
Parameters
0
Disables compression.
1
Enables compression.
Default
SORTCOMPRESS=0
Comments
When compression is enabled, run-length encoding of sort records is enabled, resulting in much better performance when records contain multiple repeated characters.

Use this variable to improve memory usage and therefore sort performance when the sort records contain many single, repeated characters; for example, multiple spaces.

The behavior when set to any positive integer is equivalent to SORTCOMPRESS=1.

SORTSCHEME

Enables the SORTSPACE environment variable, which specifies an alternative memory allocation size for sort operations.
Syntax
SORTSCHEME=1
Parameter
1
Enables the SORTSPACE environment variable.
Default
Not set. The memory allocated for sort functions is 1 megabyte.

SORTSPACE

The amount of memory to be allocated to internal workspace for SORT operations, and the format for the allocated memory.
Important: To set SORTSPACE to a value other than the default, you must first enable it using the SORTSCHEME environment variable.
Syntax
SORTSPACE=memory-spec[K|M|G]
Parameter
memory-spec
A number that represents the amount of memory to allocate. When used without an optional parameter, this number represents memory in bytes; otherwise, it represents the units specified by an optional parameter.
K
memory-spec specifies memory allocation in kilobytes.
M
memory-spec specifies memory allocation in megabytes.
G
memory-spec specifies memory allocation in gigabytes.
Default
SORTSPACE=1M
Comments
A larger value for SORTSPACE generally results 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 is degraded.

Parameter values are not case sensitive.

Example
SORTSPACE=1024K

SORTTEMPSPACE

The amount of memory to be allocated to temporary workspace for SORT operations.
Syntax
SORTTEMPSPACE=memory-spec[K|M|G]
Parameters
Important: The value specified must be equivalent to 32M or greater, irrespective of the scheme used to specify the amount of memory.
memory-spec
A number that represents the amount of memory to allocate. When used without an optional parameter, this number represents memory in bytes; otherwise, it represents the units specified by an optional parameter.
K
memory-spec specifies memory allocation in kilobytes.
M
memory-spec specifies memory allocation in megabytes.
G
memory-spec specifies memory allocation in gigabytes.
Default
SORTTEMPSPACE=32M
Comments
Use this variable to adjust the memory allocation strategy used by SORT. This can generally improve performance in systems suffering from memory fragmentation.

Parameter values are not case sensitive.

Example
SORTTEMPSPACE=250M

SORTTYPE

Sets SORT operations to use the file handler.
Syntax
SORTTYPE=2
Parameter
2
Forces SORT to use the file handler, which picks up format modifications from the extfh.cfg file.
Default
Not set. SORT attempts to use CBL_ library routines to read and write files to improve performance.