For example, the numeric missing value (.) is sorted before the special numeric missing
value .A, and both are sorted before the special missing value .Z. SAS does not
distinguish between lowercase and uppercase letters when sorting special numeric
missing values.
Note: The numeric missing value sort order is the same regardless of whether your
system uses the ASCII or EBCDIC collating sequence.
Character Variables
Missing values of character variables are smaller than any printable character value.
Therefore, when you sort a data set by a character variable, observations with missing
(blank) values of the BY variable always appear before observations in which values of
the BY variable contain only printable characters. However, some usually unprintable
characters (for example, machine carriage-control characters and real or binary numeric
data that have been read in error as character data) have values less than the blank.
Therefore, when your data includes unprintable characters, missing values might not
appear first in a sorted data set.
When Variable Values Are Automatically Set to
Missing by SAS
When Reading Raw Data
At the beginning of each iteration of the DATA step, SAS sets the value of each variable
that you create in the DATA step to missing, with the following exceptions:
variables named in a RETAIN statement
variables created in a SUM statement
data elements in a _TEMPORARY_ array
variables created with options in the FILE or INFILE statements
variables created by the FGET function
data elements that are initialized in an ARRAY statement
automatic variables
SAS replaces the missing values as it encounters values that you assign to the variables.
Thus, if you use program statements to create new variables, their values in each
observation are missing until you assign the values in an assignment statement, as shown
in the following DATA step:
data new;
input x;
if x=1 then y=2;
datalines;
4
1
3
1
;
86 Chapter 5 Missing Values

Get SAS 9.4 Language Reference, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.