Previous Page | Next Page

Creating Subsets of Observations

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  750 Medium D'Amico
Paris     8 1680 High   Lucas
London    6 1230 High   Wilson
New York  6    .        Lucas
Madrid    3  370 Low    Torres
Amsterdam 4  580 Low

The numbered fields represent

[1] the name of the destination city

[2] the number of nights on the tour

[3] the cost of the land package in US dollars

[4] a rating of the budget

[5] the name of the tour guide

The following program creates a permanent SAS data set named MYLIB.ARTS:

options pagesize=60 linesize=80 pageno=1 nodate;
libname mylib 'permanent-data-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';
run;

The PROC PRINT statement that follows the DATA step produces this display of the MYLIB.ARTS data set:

Data Set MYLIB.ARTS

                               Data Set MYLIB.ARTS                              1

                                          Land               Tour
            Obs    City         Nights    Cost    Budget     Guide

             1     Rome            3       750    Medium    D'Amico
             2     Paris           8      1680    High      Lucas  
             3     London          6      1230    High      Wilson 
             4     New York        6         .              Lucas  
             5     Madrid          3       370    Low       Torres 
             6     Amsterdam       4       580    Low              

Previous Page | Next Page | Top of Page