Creating Subsets of Observations |
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 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 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
Copyright © 2012 by SAS Institute Inc., Cary, NC, USA. All rights reserved.