Acting on Selected Observations |
Tradewinds Travel offers tours to art museums and galleries in various cities. The company has decided that in order to make its process more efficient, additional information is needed. For example, if the tour covers too many museums and galleries within a time period, then the number of museums visited must be decreased or the number of days for the tour needs to change. If the guide who is assigned to the tour is not available, then another guide must be assigned. Most of the process involves selecting observations that meet or that do not meet various criteria and then taking the required action.
The Tradewinds Travel tour data is stored in an external file that contains the following information:
1 2 3 4 5 6 7 Rome 3 750 7 4 M, 3 G D'Amico Torres Paris 8 1680 6 5 M, 1 other Lucas Lucas London 6 1230 5 3 M, 2 G Wilson Lucas New York 6 . 8 5 M, 1 G, 2 other Lucas D'Amico Madrid 3 370 5 3 M, 2 other Torres D'Amico Amsterdam 4 580 6 3 M, 3 G Vandever
the number of events the trip offers (such as visits to museums and galleries) | |
a brief description of the events (where M indicates a museum; G , a gallery; and other , another kind of event) | |
The following DATA step creates MYLIB.ARTTOURS:
options pagesize=60 linesize=80 pageno=1 nodate; libname mylib 'permanent-data-library'; data mylib.arttours; infile 'input-file' truncover; input City $ 1-9 Nights 11 LandCost 13-16 NumberOfEvents 18 EventDescription $ 20-36 TourGuide $ 38-45 BackUpGuide $ 47-54; run; proc print data=mylib.arttours; title 'Data Set MYLIB.ARTTOURS'; run;
Note: When the TRUNCOVER option is specified in the INFILE statement, and when the record is shorter than what the INPUT statement expects, SAS will read a variable length record.
The PROC PRINT statement that follows the DATA step produces this display of the MYLIB.ARTTOURS data set:
Data Set MYLIB.ARTTOURS 1 3 4 Land Number 1 2 Tour BackUp Obs City Nights Cost OfEvents EventDescription Guide Guide 1 Rome 3 750 7 4 M, 3 G D'Amico Torres 2 Paris 8 1680 6 5 M, 1 other Lucas Lucas 3 London 6 1230 5 3 M, 2 G Wilson Lucas 4 New York 6 . 8 5 M, 1 G, 2 other Lucas D'Amico 5 Madrid 3 370 5 3 M, 2 other Torres D'Amico 6 Amsterdam 4 580 6 3 M, 3 G Vandever
The following list corresponds to the numbered items in the preceding output:
Copyright © 2012 by SAS Institute Inc., Cary, NC, USA. All rights reserved.