Understanding DATA Step Processing |
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
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
Copyright © 2012 by SAS Institute Inc., Cary, NC, USA. All rights reserved.