O'Reilly logo

Step-by-Step Programming with Base SAS 9.4, Second Edition, 2nd Edition by SAS Institute

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Introduction to Raw Data
Purpose
To create a SAS data set from raw data, you must examine the data records first to
determine how the data values that you want to read are arranged. Then you can look at
the styles of reading input that are available in the INPUT statement. SAS provides three
basic input styles:
list
column
formatted
You can use these styles individually, in combination with each other, or in conjunction
with various line-hold specifiers, line-pointer controls, and column-pointer controls. This
section demonstrates various ways of using the INPUT statement to turn your raw data
into SAS data sets.
You can enter the data directly in a DATA step or use an existing file of raw data. If your
data is machine readable, then you need to learn how to use those tools that enable SAS
to read them. If your data is not yet entered, then you can choose the input style that
enables you to enter the data most easily.
Prerequisites
Before continuing, you should understand the concepts presented in the following
sections:
Chapter 1, “What is the SAS System?,” on page 3
Chapter 3, “Introduction to DATA Step Processing,” on page 27
Examine the Structure of the Raw Data: Factors
to Consider
Before you can select the appropriate style of input, examine the structure of the raw
data that you want to read. Consider some of the following factors:
how the data is arranged in the input records. For example, are data fields aligned in
columns or unaligned? Are they separated by blanks or by other characters?
whether character values contain embedded blanks
whether numeric values contain nonnumeric characters such as commas
whether the data contains time or date values
whether each input record contains data for more than one observation
whether data for a single observation is spread over multiple input records
52 Chapter 4 Starting with Raw Data: The Basics

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required