Chapter 3, “Introduction to DATA Step Processing,” on page 27
Chapter 4, “Starting with Raw Data: The Basics,” on page 51
Chapter 5, “Starting with Raw Data: Beyond the Basics,” on page 71
Chapter 6, “Starting with SAS Data Sets,” on page 91
Chapter 10, “Acting on Selected Observations,” on page 147
Chapter 7, “Understanding DATA Step Processing,” on page 107
Input SAS Data Set for Examples
Tradewinds Travel has a schedule for tours to various art museums and galleries. It
would be convenient to keep different SAS data sets that contain different information
about the tours. The tour data is stored in an external file that contains the following
1 2 3 4 5
Rome 3 1550 Medium D'Amico
Brasilia 8 3360 High Lucas
London 6 2460 Medium Wilson
Warsaw 6 . Lucas
Madrid 3 740 Low Torres
Amsterdam 4 1160 Low
The following list describes the fields in the input file:
provides the name of the destination city
specifies the number of nights on the tour
specifies the cost of the land package in U.S. dollars
specifies a rating for the budget
provides the name of the tour guide
The following program creates a permanent SAS data set named MYLIB.ARTS:
libname mylib 'SAS-library';
data mylib.arts;
infile 'input-file' truncover;
input City $ 1-9 Nights 11 LandCost 13-16 Budget $ 18-23
TourGuide $ 25-32;
proc print data=mylib.arts;
title 'Data Set MYLIB.ARTS';
170 Chapter 11 Creating Subsets of Observations

Get Step-by-Step Programming with Base SAS 9.4, Second Edition, 2nd Edition now with O’Reilly online learning.

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