Chapter 8: Reading Data from External Files

Introduction

This chapter describes three of the most common methods that you can use to read raw text data using SAS. It also demonstrates how to create SAS data sets from CSV files. If you typically receive data that is already in SAS data sets, you can skip this chapter (unless you are just curious).

Reading Data Values Separated by Delimiters

One method of storing data in text files is to separate data values by a delimiter, usually blanks or commas. SAS refers to this as list input.

Let’s start out with a file where blanks (spaces) are used as delimiters. This is a good starting place because a blank is the default delimiter in SAS. In this example, the data file that you want to read contains ...

Get Getting Started with SAS Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.