HomeReference Guides

Default Sorting Order of Characters in SAS1 min read

Like Tweet Pin it Share Share Email

Sorting Orders for Numeric Variables

Numeric variables are sorted from the smallest-to-largest comparison and the sequence is as below.

  • SAS System missing values (shown as a period or special missing value)
  • negative numeric values
  • zero
  • positive numeric values.

Sorting Orders for Character Variables

PROC SORT uses either the EBCDIC or the ASCII collating sequence when it compares character values, depending on the environment under which the procedure is running.

In EBCDIC sequence, lowercase characters are sorted first followed by upper characters and then the digits. Note that some special characters interrupt the alphabetic sequences. The blank is the smallest displayable character.

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.