Input SAS Data Set for Examples

Tradewinds Travel has an external file with data on flight schedules for tours.
The following DATA step reads the information and stores it in a data set named AIR.DEPARTURES:
libname mylib 'permanent-data-library';

data mylib.departures;
   input Country $ 1-9 CitiesInTour 11-12 USGate $ 14-26 
         ArrivalDepartureGates $ 28-48;
   datalines;

1          2 3                      4
------------------------------------------------
Japan      5 San Francisco          Tokyo, Osaka
Italy      8 New York               Rome, Naples
Australia 12 Honolulu           Sydney, Brisbane
Venezuela  4 Miami            Caracas, Maracaibo
Brazil     4               Rio de Janeiro, Belem
;
proc print data=mylib.departures;
   title 'Data Set AIR.DEPARTURES';
run;
The numbered fields represent
1 the name of the country toured
2 the number of cities in the tour
3 the city from which the tour leaves the United States (the gateway city)
4 the cities of arrival and departure in the destination country
The PROC PRINT statement that follows the DATA step produces this display of the AIR.DEPARTURES data set:
Display 9.1 Data Set AIR.DEPARTURES
Data Set AIR.DEPARTURES
In AIR.DEPARTURES, the variables Country, USGate, and ArrivalDepartureGates contain information other than numbers, so they must be stored as character variables. The variable CitiesInTour contains only numbers. Therefore, it can be created and stored as either a character or numeric variable.
..................Content has been hidden....................

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