Previous Page | Next Page

Understanding DATA Step Processing

Input SAS Data Set for Examples

Tradewinds Travel Inc. has an external file that they use to manipulate and store data about their tours. The external file contains the following information:

1      2  3   4   5 
France 8 793 575 Major
Spain 10 805 510 Hispania
India 10   . 489 Royal
Peru   7 722 590 Mundial

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

Notice that the cost of the airfare for the tour to India has a missing value, which is indicated by a period.

The following DATA step creates a permanent SAS data set named MYLIB.INTERNATIONALTOURS:

options pagesize=60 linesize=80 pageno=1 nodate;
libname mylib 'permanent-data-library';

data mylib.internationaltours;
    infile 'input-file';
    input Country $ Nights AirCost LandCost Vendor $;

proc print data = mylib.internationaltours;
   title 'Data Set MYLIB.INTERNATIONALTOURS';
run;

The PROC PRINT statement that follows the DATA step produces this display of the MYLIB.INTERNATIONALTOURS data set:

Creating a Permanent SAS Data Set

                       Data Set MYLIB.INTERNATIONALTOURS                       1

                                           Air    Land
              Obs    Country    Nights    Cost    Cost    Vendor

               1     France        8       793     575    Major   
               2     Spain        10       805     510    Hispania
               3     India        10         .     489    Royal   
               4     Peru          7       722     590    Mundial 

Previous Page | Next Page | Top of Page