Finding Shortcuts in Programming |
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 program creates the permanent SAS data set MYLIB.ATTRACTIONS:
options pagesize=60 linesize=80 pageno=1 nodate; 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;
The PROC PRINT statement that follows the DATA step produces this report of the MYLIB.ATTRACTIONS data set:
Data Set MYLIB.ATTRACTIONS 1 Tour Years Obs City Museums Galleries Other Guide Experience 1 Rome 4 3 . D'Amico 2 2 Paris 5 . 1 Lucas 5 3 London 3 2 . Wilson 3 4 New York 5 1 2 Lucas 5 5 Madrid . . 5 Torres 4 6 Amsterdam 3 3 . .
Copyright © 2012 by SAS Institute Inc., Cary, NC, USA. All rights reserved.