Input File and SAS Data Set
In the following example, Tradewinds Travel is making adjustments to their data about
tours to art museums and galleries. The data for the tours is as follows:
1 2 3 4 5 6
--------------------------
Rome 4 3 . D'Amico 2
Paris 5 . 1 Lucas 5
London 3 2 . Wilson 3
New York 5 1 2 Lucas 5
Madrid . . 5 Torres 4
Amsterdam 3 3 . .
The following list explains the numbered items in the preceding file:
1
This column provides the name of the destination country.
2
This column provides the number of museums to be visited.
3
This column provides the number of art galleries in the tour.
4
This column provides the number of other attractions to be toured.
5
This column lists the last name of the tour guide.
6
This column lists the number of years of experience for the tour guide.
The following program creates the permanent SAS data set MYLIB.ATTRACTIONS:
libname mylib 'permanent-data-library';
data mylib.attractions;
infile 'input-file';
input City $ 1-9 Museums 11 Galleries 13
Other 15 TourGuide $ 17-24 YearsExperience 26;
run;
proc print data=mylib.attractions;
title 'Data Set MYLIB.ATTRACTIONS';
run;
216 Chapter 14 Finding Shortcuts in Programming

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.