Procedures under z/OS |
z/OS specifics: | available z/OS sort utilities and SORT procedure statement options; host-specific SAS system options |
Details | |
PROC SORT Statement Options | |
Specifying the SORTSEQ= Option with a Host Sort Utility | |
Example: Creating a View with a Dummy BY Variable | |
See Also |
Details |
You can direct the SORT procedure to use either the SAS sort program, which is available under z/OS and under all other operating environments, or a sort utility that is specific to z/OS. You can also use the SORTPGM= system option to choose the best sort program to use. (See SORTPGM= System Option: z/OS.)
The following SAS system options also affect any sorting that is done by SAS:
You can see the values of the preceding options by submitting:
proc options group=sort; run;
PROC SORT Statement Options |
The following host-specific sort options are available in the PROC SORT statement under z/OS in addition to the statement options that are available under all host operating environments. The list includes the portable EQUALS option because it has aspects that are specific to z/OS.
passes the DIAG parameter to the sort utility. If the utility supports this option, then it produces additional diagnostic information if the sort fails.
passes the EQUALS parameter to the sort utility program whether the sort utility supports it. SAS software defaults to EQUALS by passing the parameter to the utility if the SAS system option SORTEQOP is in effect.
specifies how many bytes to leave unallocated in the region. Occasionally, the SORT procedure runs out of main storage. If main storage is exceeded, rerun the job and increase the LEAVE= value (which has a default value of 16000) by 30000.
provides additional information about the system sort. Not all sort utilities support the specification of the LIST option; they might require that it be specified when the sort utility is generated or installed. This option is the default action if the SAS system option SORTLIST is in effect. Also, this option overrides NOSORTLIST if it is in effect.
prints a summary of the system sort utility's actions. This option is the default action if the SAS system option SORTMSG is in effect. Also, this option overrides NOSORTMSG if it is in effect. MESSAGE is useful if you run PROC SORT and the SAS log prints a message indicating that the sort did not work properly. Explanations of the message can be found in the IBM or vendor reference manual that describes your system sort utility.
specifies the maximum virtual storage that can be used by the system sort utility. If not specified, the default sort size is given by the SAS system option SORTSIZE=.
specifies how many sort work areas PROC SORT allocates. If a value is not specified, the default is given by the SAS system option SORTWKNO=. The range for SORTWKNO is 0-99.
specifies a four-character sort technique to be passed to the system sort utility. SAS does not check the validity of the specified value, so you must ensure that it is correct.
Specifying the SORTSEQ= Option with a Host Sort Utility |
The SORTSEQ= option enables you to specify the collating sequence for your sort. For more information, see SORTSEQ= System Option: UNIX, Windows, and z/OS in the SAS National Language Support (NLS): Reference Guide.
In other words, for the sort to work the translation table must map each character to a unique weight, and the inverse table must map each weight to a unique character variable.
If your translation tables do not map one-to-one, then you can use one of the following methods to perform your sort:
create a translation table that maps one-to-one. Once you create a translation table that maps one-to-one, you can easily create a corresponding inverse table using the TRANTAB procedure. If your table is not mapped one-to-one, then you will receive the following note in the SAS log when you try to create an inverse table:
NOTE: This table cannot be mapped one to one.For more information, see The TRANTAB Procedure in the SAS National Language Support (NLS): Reference Guide.
use the SAS sort. You can specify the SAS sort using the SORTPGM system option. For more information, see SORTPGM= System Option: z/OS.
specify the collation order options of your host sort utility. See the documentation for your host sort utility for more information.
create a view with a dummy BY variable. For an example, see Example: Creating a View with a Dummy BY Variable.
Note: After using one of these methods, you might need to perform subsequent BY processing using either the NOTSORTED option or the NOBYSORTED system option. For more information about the NOTSORTED option, see "BY Statement" in SAS Language Reference: Dictionary. For more information about the NOBYSORTED system option, see "BYSORTED System Option" in SAS Language Reference: Dictionary.
The following code is an example of creating a view using a dummy BY variable:
options sortpgm=host msglevel=i; data one; input name $ age; datalines; anne 35 ALBERT 10 JUAN 90 janet 5 bridget 23 BRIAN 45 ; data oneview / view=oneview; set one; name1=upcase(name); run; proc sort data=oneview out=final(drop=name1); by name1; run; proc print data=final; run;
The output is the following:
Creating a View with a Dummy BY Variable
The SAS System Obs name age 1 ALBERT 10 2 anne 35 3 BRIAN 45 4 bridget 23 5 janet 5 6 JUAN 90
See Also |
SORT Procedure in Base SAS Procedures Guide
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.