|
Chapter Contents |
Previous |
Next |
| The DATASOURCE Procedure |
In this example, exports and imports of goods and services are extracted to demonstrate how to work with a National Income and Product Accounts Tape file.
From the "Statistical Tables" published by the United States Department of Commerce, Bureau of Economic Analysis, exports and imports of goods and services are given in the second table (TABNUM='02') of the "Foreign Transactions" section (PARTNO='4'). This table does not have any table suffix A or B. Moreover, the first line in the table gives exports, while the eighth gives imports. Therefore, the series names for exports and imports are __00100 and __00800, where the first underscore is inserted by the procedure, the second underscore is the place holder for the table suffix, the following three digits are the line numbers, and the last two digits are the column numbers.
The following statements put this information together to extract quarterly exports and imports from a BEANIPA type file:
filename datafile 'host-specific-path-name' host-options;
proc datasource filetype=beanipa infile=datafile
interval=qtr out=foreign;
keep __00100 __00800;
where partno='4' and tabnum='02';
label __00100='Exports of Goods and Services';
label __00800='Imports of Goods and Services';
rename __00100=exports __00800=imports;
run;
The plot of EXPORTS and IMPORTS against DATE is shown in Output 10.1.1.
Output 10.1.1: Plot of Time Series in the OUT= Data Set for FILETYPE=BEANIPA
|
|
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.