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
information:
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:
1
provides the name of the destination city
2
specifies the number of nights on the tour
3
specifies the cost of the land package in U.S. dollars
4
specifies a rating for the budget
5
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;
run;
proc print data=mylib.arts;
title 'Data Set MYLIB.ARTS';
run;
170 Chapter 11 Creating Subsets of Observations

Get Step-by-Step Programming with Base SAS 9.4, Second Edition, 2nd 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.