SASEBEA Interface Engine
Example 22.3 Retrieving All Tables for GDP by Industry from the UnderlyingGDPbyIndustry Data Set
In this example, the BEA data set name is UnderlyingGDPbyIndustry, as specified in the SETNAME= option. The TABLEID=ALL specifies that the statistics for all table IDs are requested for the gross domestic product industry (INDUSTRY='GDP'). The YEAR=ALL option specifies that the range of data is for all available years. The output is shown in Output 22.3.1, which contains nine variables, whose names are prefixed with the industry code (GDP) followed by '_'. With the exception of the DATE variable, the variable names also have a suffix of '_', followed by the table ID. Between the prefix and suffix is the main part of the name, which is the truncated description of the time series. Together, the three parts, prefix, description and suffix, name each of the time series variables in the SAS output data set. The FREQ= option selects annual data, and 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.3.1 shows the output for all available years.
options;
title 'Request GDP Statistics from Underlying Gross Domestic Product by Industry';
LIBNAME beagu sasebea "physical path to your folder for storing the BEA data"
setname=underlyingGDPbyIndustry
TableID=ALL
user='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
freq=A
industry='GDP'
outjson=gdp3u
year=ALL
format=json;
data myGDP3U;
set beagu.gdp3u;
run;
proc print data=myGDP3U; run;
Output 22.3.1: Gross Domestic Product: From UnderLyingGDPbyIndustry Data Set, All Table IDS
| Request GDP Statistics from Underlying Gross Domestic Product by Industry |
| Obs | Date | _GDP_Gross_domestic_prod_210 | _GDP_Gross_domestic_prod_211 | _GDP_Gross_domestic_prod_212 | _GDP_Gross_domestic_prod_213 | _GDP_Gross_domestic_prod_214 | _GDP_Gross_domestic_prod_215 | _GDP_Gross_domestic_prod_216 | _GDP_Gross_domestic_prod_217 | _GDP_Gross_domestic_prod_218 |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 1997 | 8577.6 | 100.0 | 70.931 | 11529.2 | 74.399 | ||||
| 2 | 1998 | 9062.8 | 100.0 | 74.110 | 4.5 | 12045.8 | 75.219 | 1.1 | 4.5 | 1.1 |
| 3 | 1999 | 9631.2 | 100.0 | 77.663 | 4.8 | 12623.4 | 76.272 | 1.4 | 4.8 | 1.4 |
| 4 | 2000 | 10251.0 | 100.0 | 80.830 | 4.1 | 13138.0 | 78.016 | 2.3 | 4.1 | 2.3 |
| 5 | 2001 | 10581.9 | 100.0 | 81.601 | 1.0 | 13263.4 | 79.814 | 2.3 | 1.0 | 2.3 |
| 6 | 2002 | 10929.1 | 100.0 | 82.985 | 1.7 | 13488.4 | 81.013 | 1.5 | 1.7 | 1.5 |
| 7 | 2003 | 11456.5 | 100.0 | 85.305 | 2.8 | 13865.5 | 82.635 | 2.0 | 2.8 | 2.0 |
| 8 | 2004 | 12217.2 | 100.0 | 88.592 | 3.9 | 14399.7 | 84.842 | 2.7 | 3.9 | 2.7 |
| 9 | 2005 | 13039.2 | 100.0 | 91.678 | 3.5 | 14901.3 | 87.490 | 3.1 | 3.5 | 3.1 |
| 10 | 2006 | 13815.6 | 100.0 | 94.229 | 2.8 | 15315.9 | 90.212 | 3.1 | 2.8 | 3.1 |
| 11 | 2007 | 14474.2 | 100.0 | 96.123 | 2.0 | 15623.9 | 92.653 | 2.7 | 2.0 | 2.7 |
| 12 | 2008 | 14769.9 | 100.0 | 96.241 | 0.1 | 15643.0 | 94.397 | 1.9 | 0.1 | 1.9 |
| 13 | 2009 | 14478.1 | 100.0 | 93.739 | -2.6 | 15236.3 | 95.019 | 0.7 | -2.6 | 0.7 |
| 14 | 2010 | 15049.0 | 100.0 | 96.278 | 2.7 | 15649.0 | 96.164 | 1.2 | 2.7 | 1.2 |
| 15 | 2011 | 15599.7 | 100.0 | 97.770 | 1.5 | 15891.5 | 98.157 | 2.1 | 1.5 | 2.1 |
| 16 | 2012 | 16254.0 | 100.0 | 100.000 | 2.3 | 16254.0 | 100.000 | 1.9 | 2.3 | 1.9 |
| 17 | 2013 | 16843.2 | 100.0 | 101.842 | 1.8 | 16553.3 | 101.769 | 1.8 | 1.8 | 1.8 |
| 18 | 2014 | 17550.7 | 100.0 | 104.172 | 2.3 | 16932.1 | 103.662 | 1.9 | 2.3 | 1.9 |
| 19 | 2015 | 18206.0 | 100.0 | 106.991 | 2.7 | 17390.3 | 104.662 | 1.0 | 2.7 | 1.0 |
| 20 | 2016 | 18695.1 | 100.0 | 108.775 | 1.7 | 17680.3 | 105.703 | 1.0 | 1.7 | 1.0 |
| 21 | 2017 | 19479.6 | 100.0 | 111.229 | 2.3 | 18079.1 | 107.742 | 1.9 | 2.3 | 1.9 |
| 22 | 2018 | 20527.2 | 100.0 | 114.475 | 2.9 | 18606.8 | 110.326 | 2.4 | 2.9 | 2.4 |
| 23 | 2019 | 21372.6 | 100.0 | 117.096 | 2.3 | 19032.7 | 112.279 | 1.8 | 2.3 | 1.8 |
| 24 | 2020 | 20893.7 | 100.0 | 113.109 | -3.4 | 18384.7 | 113.740 | 1.3 | -3.4 | 1.3 |