Numeric
data can be represented in several ways. SAS can read standard numeric
values without any special instructions. To read nonstandard values,
SAS requires special instructions in the form of informats.
Reading Different Types of Numeric Data shows standard, nonstandard, and invalid numeric data values
and the special tools, if any, that are required to read them. For
complete descriptions of all SAS informats, see
SAS Formats and Informats: Reference.
Reading Different Types of Numeric Data
|
|
Solution Required to
Read
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
in E notation, 2.30
(ss1)
|
|
|
in E notation, 230x10
(ss-1)
|
|
|
minus sign for negative
numbers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
minus sign follows number
|
Put minus sign before
number or solve programmatically.
|
|
double instead of single
periods
|
Code missing values
as a single period or use the ?? modifier in the INPUT statement to
code any invalid input value as a missing value.
|
|
|
Read as a character
value, or edit the raw data to change it to a valid number.
|
Remember the following
rules for reading numeric data:
-
Parentheses or a minus sign preceding
the number (without an intervening blank) indicates a negative value.
-
Leading zeros and the placement
of a value in the input field do not affect the value assigned to
the variable. Leading zeros and leading and trailing blanks are not
stored with the value. Unlike some languages, SAS does not read trailing
blanks as zeros by default. To cause trailing blanks to be read as
zeros, use the BZ. informat described in
SAS Formats and Informats: Reference.
-
Numeric data can have leading and
trailing blanks but cannot have embedded blanks (unless they are read
with a COMMA. or BZ. informat).
-
To read decimal values from input
lines that do not contain explicit decimal points, indicate where
the decimal point belongs by using a decimal parameter with column
input or an informat with formatted input. See the full description
of the INPUT statement in
SAS Formats and Informats: Reference for
more information. An explicit decimal point in the input data overrides
any decimal specification in the INPUT statement.