SASEMOOD Interface Engine
Example 24.2 Retrieving Quarterly Gross Domestic Product Data by Industry from the Bureau of Economic Analysis (BEA)
This example shows how to retrieve gross domestic product data by industry, starting in the second quarter of 2016 and ending in the third quarter of 2018. The output, which is shown in Output 24.2.1, contains two variables, Date and PDPGPOD1Q.IUSA. The SAS system option VALIDVARNAME=ANY allows for the special character '.' in the mnemonic code; the same mnemonic code is used to name the SAS variable’s series name in the SAS output data set.
The MNEMONIC= option specifies the Moody’s time series data to retrieve, which in this example is PDPGPOD1Q.IUSA. The FREQ= option selects the quarterly frequency, and the START= and END= options define the date range of the retrieved data.
options;
title 'Request Gross Domestic Product by Industry, Quarterly Data';
LIBNAME moody sasemood "%sysget(MOOD_DATA)"
mnemonic="PDPGPOD1Q.IUSA"
user='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
pass='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
freq=quarterly
conv=cubic
outjson=GDPI
start='2016-01-01'
end='2018-06-01'
format=json
;
data myIGDPQ;
set moody.GDPI;
run;
proc print data=myIGDPQ; run;
Output 24.2.1: GDP by Industry: Chain-Type Price Index for Value Added – All Industries
| Request Gross Domestic Product by Industry, Quarterly Data |
| Obs | date | PDPGPOD1Q.IUSA |
|---|---|---|
| 1 | 2016-03-31 | 104.933 |
| 2 | 2016-06-30 | 105.618 |
| 3 | 2016-09-30 | 105.987 |
| 4 | 2016-12-31 | 106.543 |
| 5 | 2017-03-31 | 107.040 |
| 6 | 2017-06-30 | 107.394 |
| 7 | 2017-09-30 | 108.032 |
| 8 | 2017-12-31 | 108.715 |
| 9 | 2018-03-31 | 109.341 |
| 10 | 2018-06-30 | 110.209 |