Types of Data
data values
are character or numeric values.
numeric value
contains only numbers, and sometimes a decimal point, a minus sign, or both. When
they are read into a SAS data set, numeric values are stored in the floating-point
format native to the operating environment. Nonstandard numeric values can contain
other characters as numbers; you can use formatted input to enable SAS to read
character value
is a sequence of characters.
standard data
are character or numeric values that can be read with list, column, formatted, or
named input. Examples of standard data include:
nonstandard data
is data that can be read only with the aid of informats. Examples of nonstandard data
include numeric values that contain commas, dollar signs, or blanks; date and time
values; and hexadecimal and binary values.
Numeric Data
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. Table 19.1 on page 409 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.
Table 19.1 Reading Different Types of Numeric Data
Example of Numeric Data Description
Solution Required to
Standard Numeric Data
input right aligned None needed
input not aligned None needed
input left aligned None needed
Types of Data 409
Example of Numeric Data Description
Solution Required to
input with leading zeros None needed
input with decimal point None needed
in E notation, 2.30 (ss1) None needed
in E notation, 230x10 (ss-1) None needed
minus sign for negative
None needed
Nonstandard Numeric Data
2 3
embedded blank COMMA. or BZ. informat
- 23
embedded blank COMMA. or BZ. informat
comma COMMA. informat
parentheses COMMA. informat
hexadecimal value HEX. informat
date value DATE. informat
Invalid Numeric Data
23 -
minus sign follows number Put minus sign before
number or solve
double instead of single
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.
not a number Read as a character value,
or edit the raw data to
change it to a valid
Remember the following rules for reading numeric data:
Parentheses or a minus sign preceding the number (without an intervening blank)
indicates a negative value.
It might be possible to use the S370FZDTw.d informat, but positive values require the trailing plus sign (+).
410 Chapter 19 Reading Raw Data

Get SAS 9.4 Language Reference, 3rd 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.