Input SAS Data Set for Examples

Tradewinds Travel Inc. has an external file that contains information about their most popular tours:
1             2  3   4    5
-----------------------------------
Japan         8  982 1020 Express
Greece       12   .   748 Express
New Zealand  16 1368 1539 Southsea
Ireland       7  787  628 Express
Venezuela     9  426  505 Mundial
Italy         8  852  598 Express
Russia       14 1106 1024 A-B-C
Switzerland   9  816  834 Tour2000
Australia    12 1299 1169 Southsea
Brazil        8  682  610 Almeida
The numbered fields represent
1 the name of the country toured
2 the number of nights on the tour
3 the airfare in US dollars
4 the cost of the land package in US dollars
5 the name of the company that offers the tour
The following program creates a permanent SAS data set named MYLIB.POPULARTOURS:
libname mylib 'permanent-data-library';

data mylib.populartours;
   infile 'input-file';
   input Country $ 1-11 Nights AirCost LandCost Vendor $;
run;

proc print data=mylib.populartours;
   title 'Data Set MYLIB.POPULARTOURS';
run;
The following output displays the data set:
Display 8.1 Data Set MYLIB.POPULARTOURS
Data Set MYLIB.POPULARTOURS
In MYLIB.POPULARTOURS, the variables Nights, AirCost, and LandCost contain numbers and are stored as numeric variables. For comparison, variables Country and Vendor contain alphabetic and special characters as well as numbers; they are stored as character variables.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.201.168