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 validvarname=any;

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

ObsDate_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
119978577.6100.070.931 11529.274.399   
219989062.8100.074.1104.512045.875.2191.14.51.1
319999631.2100.077.6634.812623.476.2721.44.81.4
4200010251.0100.080.8304.113138.078.0162.34.12.3
5200110581.9100.081.6011.013263.479.8142.31.02.3
6200210929.1100.082.9851.713488.481.0131.51.71.5
7200311456.5100.085.3052.813865.582.6352.02.82.0
8200412217.2100.088.5923.914399.784.8422.73.92.7
9200513039.2100.091.6783.514901.387.4903.13.53.1
10200613815.6100.094.2292.815315.990.2123.12.83.1
11200714474.2100.096.1232.015623.992.6532.72.02.7
12200814769.9100.096.2410.115643.094.3971.90.11.9
13200914478.1100.093.739-2.615236.395.0190.7-2.60.7
14201015049.0100.096.2782.715649.096.1641.22.71.2
15201115599.7100.097.7701.515891.598.1572.11.52.1
16201216254.0100.0100.0002.316254.0100.0001.92.31.9
17201316843.2100.0101.8421.816553.3101.7691.81.81.8
18201417550.7100.0104.1722.316932.1103.6621.92.31.9
19201518206.0100.0106.9912.717390.3104.6621.02.71.0
20201618695.1100.0108.7751.717680.3105.7031.01.71.0
21201719479.6100.0111.2292.318079.1107.7421.92.31.9
22201820527.2100.0114.4752.918606.8110.3262.42.92.4
23201921372.6100.0117.0962.319032.7112.2791.82.31.8
24202020893.7100.0113.109-3.418384.7113.7401.3-3.41.3


Last updated: July 09, 2026