SASEMOOD Interface Engine
Example 24.5 Retrieving GDP by Industry: Chain-Type Price Index for Value Added for the United States
This example shows how to retrieve multiple time series for GDP by industry—utilities, manufacturing, finance, and all industries—starting January 1, 2016, and ending June 1, 2018. The MNEMONIC= option specifies the Moody’s data to retrieve. This example lists four mnemonic codes, separated by semicolons. The FREQ= option specifies quarterly data intervals, and the START= and END= options define the date range of the data. The output is shown in Output 24.5.1, which contains five variables: Date, PDPGPOD1Q.IUSA, PDPGPO22D1Q.IUSA, PDPGPOMFD1Q.IUSA, and PDPGPOFID1Q.IUSA. The SAS system option VALIDVARNAME=ANY allows for the special character '.' in the mnemonic name list; this list is used to name the SAS variables (time series) in the SAS output data set.
options;
title 'Request Gross Domestic Product by Industry for Multiple Time Series';
LIBNAME moody sasemood "%sysget(MOOD_DATA)"
mnemonic="PDPGPOD1Q.IUSA;PDPGPO22D1Q.IUSA;PDPGPOMFD1Q.IUSA;PDPGPOFID1Q.IUSA"
user='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
pass='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
mnemonic="PDPGPOD1Q.IUSA;PDPGPO22D1Q.IUSA;PDPGPOMFD1Q.IUSA;PDPGPOFID1Q.IUSA"
freq=quarterly
conv=cubic
outjson=incGDP
start='2016-01-01'
end='2018-06-01'
format=json;
data myIGDPQ;
set moody.incGDP;
run;
proc print data=work.myIGDPQ; run;
Output 24.5.1: Four Time Series for GDP by Industry: Utilities, Manufacturing, Insurance, and All Industries
| Request Gross Domestic Product by Industry for Multiple Time Series |
| Obs | date | PDPGPOD1Q.IUSA | PDPGPO22D1Q.IUSA | PDPGPOMFD1Q.IUSA | PDPGPOFID1Q.IUSA |
|---|---|---|---|---|---|
| 1 | 2016-03-31 | 104.933 | 107.363 | 103.553 | 112.061 |
| 2 | 2016-06-30 | 105.618 | 107.974 | 103.663 | 113.373 |
| 3 | 2016-09-30 | 105.987 | 109.396 | 103.388 | 114.571 |
| 4 | 2016-12-31 | 106.543 | 108.743 | 104.032 | 115.582 |
| 5 | 2017-03-31 | 107.040 | 109.983 | 104.439 | 115.557 |
| 6 | 2017-06-30 | 107.394 | 111.066 | 104.183 | 116.405 |
| 7 | 2017-09-30 | 108.032 | 111.542 | 105.476 | 117.472 |
| 8 | 2017-12-31 | 108.715 | 111.480 | 106.157 | 119.072 |
| 9 | 2018-03-31 | 109.341 | 115.945 | 106.367 | 120.243 |
| 10 | 2018-06-30 | 110.209 | 113.648 | 107.424 | 121.325 |