Chapter Contents |
Previous |
Next |
The SORT Procedure |
Sorting Orders for Numeric Variables |
Sorting Orders for Character Variables |
The sorting order of the English-language EBCDIC sequence is
blank . < ( + | & ! $ * ) ; ¬ - / , % _ > ?: # @ ' = " | |
a b c d e f g h i j k l m n o p q r ~ s t u v w x y z | |
{ A B C D E F G H I } J K L M N O P Q R \S T | |
U V W X Y Z | |
0 1 2 3 4 5 6 7 8 9 |
The
main features of the EBCDIC sequence are that lowercase
letters are sorted before uppercase letters, and uppercase letters are sorted
before digits. Note also that some special characters interrupt the alphabetic
sequences. The blank is the smallest displayable character.
Macintosh | PC DOS |
MS-DOS | UNIX and its derivatives |
OpenVMS | Windows |
OS/2 |
From the smallest to largest displayable character, the English-language ASCII sequence is
blank ! " # $ % & ' ( ) * + , - . /0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ | |
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z[ \] ˆ_ | |
a b c d e f g h i j k l m n o p q r s t u v w x y z { } ~ |
The main features of the ASCII sequence are that digits are sorted before uppercase letters, and uppercase letters are sorted before lowercase letters. The blank is the smallest displayable character.
Stored Sort Information |
Before PROC SORT sorts a data set, it checks the stored sort information. If you try to sort a data set the way that it is currently sorted, PROC SORT does not perform the sort and writes a message to the log to that effect. To override this behavior, use the FORCE option. If you try to sort a data set the way that it is currently sorted and you specify an OUT= data set, PROC SORT simply makes a copy of the DATA= data set.
To override the sort information that PROC SORT stores, use the _NULL_ value with the SORTEDBY= data set option. For information about SORTEDBY=, see the section on data set options in SAS Language Reference: Dictionary.
If you want to change the sort information for an existing data set, use the SORTEDBY= data set option in the MODIFY statement in the DATASETS procedure. To access the sort information that is stored with a data set, use the CONTENTS statement in PROC DATASETS. For details, see The DATASETS Procedure .
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.