This Natural profile parameter is used to control the sort program
                  		  used for the processing of SORT statements. It corresponds to
                  		  the NTSORT
                  		  macro in the Natural parameter module.
               
| Possible settings | For an explanation of the individual sort options, see SORT Parameter Syntax; for their possible settings, see Keyword Subparameters. | |
|---|---|---|
| Default setting | See Keyword Subparameters. | |
| Dynamic specification | yes |  This parameter can only be specified dynamically. In the
                           					 Natural
                           					 parameter module, the macro
                           					 NTSORT is
                           					 used instead. 
                         |  
                        				
                     
| Specification within session | no | |
Notes:
SORT or
                     			 NTSORT can be used to specify options that control the
                     			 handling of the sort program to be used when a SORT statement is
                     			 executed.
                  EXT.
                  The following topics are covered below:
The SORT parameter is specified as
                  			 follows:
               
| SORT=(keyword-subparameter=value,keyword-subparameter=value,...) | 
For names and values of the keyword subparameters, see Keyword Subparameters.
The NTSORT macro is specified as follows:
               
         NTSORT EXT=value,                                             *
               EXTEOJ=value,                                           *
               EXTNAME=value,                                          *
               EXTOPT=value,value,...,                                 *
               STORAGE=value,                                          *
               WRKSIZE=value 
               		  For names and values of the keyword subparameters, see Keyword Subparameters.
EXT
                  			 | EXTEOJ |
                  			 EXTNAME |
                  			 EXTOPT |
                  			 STORAGE |
                  			 WRKSIZE
EXT=value specifies if an
                  				external sort program is to be used or not.
               
| Value | Explanation | 
|---|---|
ON |  
                        						
                        An external sort program will be used. The use of an external sort program is possible only in batch environments, including IMS TM/BMP, TSO and TIAM. | 
OFF |  
                        						
                        The Natural sort program will be used. 
                           						  
                            This is the default value.  |  
                        					 
                     
Note:
We recommend that you set EXT=ON if your
                     				environment supports the use of an external sort program. This avoids the need
                     				to adapt WRKSIZE to the amount
                     				of data to be sorted.
                  
EXTEOJ=value specifies the
                  				action to be taken if an error is detected during the execution of the external
                  				sort program.
               
| Value | Explanation | 
|---|---|
ON |  
                        						
                        If an error is detected, sort
                           						  processing is terminated. ON requires that the sort program used
                           						  is able to detect a return code of 16 from both the E15 and
                           						  E35 sort exit routines.
                         |  
                        					 
                     
OFF |  
                        						
                        If an error is detected, Natural
                           						  withholds further calls to the sort program and ignores each record as it is
                           						  passed to the E35 sort exit routine (this is the default).
                         | 
                        						
                        					 
                     
EXTNAME=value specifies
                  				the name of the external sort program to be used.
               
| Value | Explanation | 
|---|---|
| 1 to 8 characters. | External sort program name. | 
SORT |  
                        						
                        This is the default value. | 
Note:
This subparameter does not apply under BS2000.
                  
EXTOPT=(value,value,...)
                  				specifies additional options for the external sort program.
               
Note:
This subparameter does not apply under BS2000.
                  
Natural generates the necessary field and format parameters and
                  				passes them to the external sort program. With EXTOPT,
                  				you can specify additional parameters to be passed to the external sort
                  				program. You can only specify parameters that are part of the control statement
                  				syntax of your external sort program.
               
You can specify up to two option strings which are delimited by a
                  				slash (/). The first option string is appended to the SORT control
                  				statement, the second option string is used to build an OPTION
                  				control statement. You may omit the option string before or after the slash. If
                  				the option string after the slash is omitted no OPTION control
                  				statement is generated at all.
               
The whole option string must be enclosed in single quotes ('...'). For compatibility reasons, it is still possible to have the option string enclosed in brackets instead.
For compatibility reasons, a single option string without a leading or trailing slash is handled differently. Depending on the underlying operating system, the options are appended to the following control statements:
| z/OS: | SORT control statement
                         |  
                        					 
                     
| z/VSE: | OPTION control statement
                         |  
                        					 
                     
The additional parameters can be specified as in the following example:
EXTOPT=(SIZE=E2000000,NOEQUALS,DYNALLOC=(3350,8)) EXTOPT='SIZE=E2000000,NOEQUALS,DYNALLOC=(3350,8)' EXTOPT='SIZE=E2000000,NOEQUALS,DYNALLOC=(3350,8)/NOCHECK' EXTOPT='/NOCHECK' EXTOPT='WORK=4/'
STORAGE=value specifies
                  				the type of storage medium to be used by Natural's internal sort program if
                  				there is not enough storage available in the work pool (WRKSIZE). If the
                  				number of records exceeds this storage, the internal sort program tries to use
                  				intermediate storage to additionally process records.
               
| Value | Explanation | 
|---|---|
MAIN |  
                        						
                        Only the remaining storage of
                           						  WRKSIZE is used, no other intermediate storage is
                           						  available. 
                           						  
                           This is the default setting.  |  
                        					 
                     
BP |  
                        						
                        The sort buffer pool is used as intermediate storage. | 
SD |  
                        						
                        SD files are used as intermediate storage. This value is evaluated under Com-plete only. | 
SMARTS |  
                        						
                        SMARTS portable file system is used. | 
- SD Files under Com-plete/SMARTS
 
The SD files used for sort processing are allocated as temporary SD files. They are allocated for a stack level. This means, the name syntax of the temporary SD files is:
&&STsnnnWhere:
&&Indicator for a temporary SD file STStandard prefix for the temporary SD file used for sort processing sStack level nnnSequence number within a single sort run SMARTS work files are located in the SMARTS Portable File System. The directory path must be specified with the SMARTS environment variable
$NAT_WORK_ROOT. For a SMARTS work file used for sort processing, aSORTdirectory is created with subdirectories for each user who performed a sort:$NAT_WORK_ROOT/SORT/userid. The name of the work file used for sort processing corresponds to the name of the temporary SD file under Com-plete.- Usage of Sort Buffer Pool
 
The use of a sort buffer pool only makes sense if you cannot further increase the
WRKSIZEto hold the sort records. This typically applies in online environments with a storage thread of limited size. In all other cases, you only need to specify a sufficientWRKSIZE.If you want to use a sort buffer pool, define the
SORTkeyword subparameterSTORAGE=BPto indicate that a sort buffer pool is to be used for any additional storage beyond the definedWRKSIZE. Simultaneously, use the profile parameterBPIor the parameter macroNTBPIto make a buffer pool ofTYPE=SORTandNAME=nameknown to Natural, for example:BPI=(TYPE=SORT,NAME=XYZ). When a name is specified with theBPIkeyword subparameterNAME, reference is made to a global sort buffer pool, whereas a local sort buffer pool can be specified byNAME=' '(blank).
WRKSIZE=value specifies
                  				the size of the work buffer used by the sort program.
               
The work buffer specified by WRKSIZE
                  				accommodates internal sort control data. The remaining storage is used to
                  				collect and sort the records. The size of the sort control data depends on
                  				various factors (the WRKSIZE itself, the sort record
                  				length, the number of sort keys, their size and format) and can therefore not
                  				be calculated in a formal way.
               
| Value | Explanation | 
|---|---|
 0 or 10 -
                              						  2097151 
                         |  
                        						
                        Size of work buffer (in KB). 
                           						  
                            
  |  
                        					 
                     
10 |  
                        						
                        This is the default value. | 
Note:
SORT=(EXT=OFF,WRKSIZE=1024)
The internal Natural sort program and a work buffer of 1 MB are used for sort processing.
SORT=(EXT=ON,EXTOPT='/EQUALS')
An external sort program with an OPTION EQUALS
                  				control statement is used for sort processing.
               
         NTSORT EXT=OFF,                                               *
               WRKSIZE=1024
         NTSORT EXT=ON,                                                *
               EXTOPT='/EQUALS' 
               		  The first example defines an internal Natural sort program and a
                  			 work buffer of 1 MB. The second example defines an external sort program with
                  			 an OPTION EQUALS control statement.