SASEBEA Interface Engine
Example 22.10 Retrieving Use of Commodities by Industries (Sector Level) from the InputOutput Data Set
In this example, the BEA data set name is InputOutput, as specified in the SETNAME= option. The TABLEID= option specifies that the request is for TableID 258, Use of Commodities by Industry. The YEAR= option specifies that the selected data are for two years, 2011 and 2012. The output is shown in Output 22.10.1, which contains only the kept variables specified in the KEEP= option: DATE and the variables whose names start with 'Tab258_ROW_FIRE'. Because the row code in the kept variable names is 'FIRE', only the variables in the commodity FIRE (finance, insurance, real estate, rental, and leasing) are kept. The OUTJSON= option specifies the name of the SAS output data set, which is also the name of the JSON data file that is retrieved from the BEA website and read into SAS. Output 22.10.1 shows the output for the requested years, 2011 and 2012.
options;
title 'Request Use of Commodities by Industry, Table ID 258';
LIBNAME beaIO sasebea "physical path to your folder for storing the BEA data"
setname=InputOutput
tableID='258'
user='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
outjson=IOINDC
year='2011,2012'
format=json;
data myIOIC;
set beaio.IOINDC;
run;
proc print data=myIOIC(keep=date Tab258_ROW_FIRE:); run;
Output 22.10.1: Use of Commodities by Industry (FIRE): From the InputOutput Data Set for 2011, 2012
| Request Use of Commodities by Industry, Table ID 258 |
| Obs | Date | Tab258_ROW_FIRE_COL_11 | Tab258_ROW_FIRE_COL_21 | Tab258_ROW_FIRE_COL_22 | Tab258_ROW_FIRE_COL_23 | Tab258_ROW_FIRE_COL_31G | Tab258_ROW_FIRE_COL_42 | Tab258_ROW_FIRE_COL_44RT | Tab258_ROW_FIRE_COL_48TW | Tab258_ROW_FIRE_COL_51 | Tab258_ROW_FIRE_COL_6 | Tab258_ROW_FIRE_COL_7 | Tab258_ROW_FIRE_COL_81 | Tab258_ROW_FIRE_COL_F010 | Tab258_ROW_FIRE_COL_F020 | Tab258_ROW_FIRE_COL_F040 | Tab258_ROW_FIRE_COL_FIRE | Tab258_ROW_FIRE_COL_G | Tab258_ROW_FIRE_COL_PROF | Tab258_ROW_FIRE_COL_T001 | Tab258_ROW_FIRE_COL_T019 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 2011 | 34862 | 24406 | 11153 | 26628 | 77329 | 107213 | 115014 | 75138 | 53260 | 208843 | 83477 | 62428 | 2563017 | 86795 | 190645 | 866969 | 134844 | 184358 | 2065922 | 4906380 |
| 2 | 2012 | 37703 | 31079 | 11769 | 30991 | 91746 | 124736 | 128045 | 82454 | 64151 | 219315 | 91134 | 68973 | 2627224 | 102842 | 196924 | 937733 | 149063 | 201335 | 2270227 | 5197217 |