The SASEQUAN Interface Engine

Example 43.2 Retrieving Data by Using Three Quandl Codes

This example shows how to use three Quandl codes of different native frequencies to retrieve quarterly data for corporate profits after tax (FRED/CP), gross domestic product (FRED/GDP), and total consumer credit owned and securitized, outstanding (TOTALSL). The output is shown in Output 43.2.1.

title 'Retrieve Data for Three Time Series: FRED/CP, FRED/GDP, FRED/TOTALSL';
libname _all_ clear;
options validvarname=any;
libname mylib "U:\quan950\doc\";

libname myQ3 sasequan "%sysget(QUANDL)"
   OUTXML=fred3
   AUTOMAP=replace
   MAPREF=MyMap
   XMLMAP="%sysget(QUANDl)fred3.map"
   APIKEY='XXXXXXXXXXXXXXXXXXXX'
   IDLIST='FRED/CP,FRED/GDP,FRED/TOTALSL'
   FORMAT=xml
   START='2009-07-01'
   END='2013-07-01'
   FREQ='quarterly'
   COLLAPSE='quarterly'
   ;

data mylib.thrall;
   set myQ3.fred3;
   label Value_1 = "Corporate Profits After Tax";
   label Value_2 = "Gross Domestic Product, 1 Decimal";
   label Value_3 = "Total Consumer Credit Owned and Securitized, Outstanding";
run;
proc contents data=mylib.thrall; run;
proc print data=mylib.thrall label; run;

Output 43.2.1: Retrieve Data for Corporate Profits after Tax, Gross Domestic Product, Total Consumer Credit Owned and Securitized, Outstanding

Retrieve Data for Three Time Series: FRED/CP, FRED/GDP, FRED/TOTALSL

Obs date Corporate Profits
After Tax
Gross Domestic
Product, 1 Decimal
Total Consumer
Credit Owned
and Securitized,
Outstanding
1 2009-09-30 1259.6 14384.4 2577.25
2 2009-12-31 1382.2 14564.1 2553.48
3 2010-03-31 1446.9 14672.5 2537.65
4 2010-06-30 1431.2 14879.2 2521.71
5 2010-09-30 1492.1 15049.8 2520.66
6 2010-12-31 1486.9 15231.7 2648.09
7 2011-03-31 1399.2 15242.9 2675.45
8 2011-06-30 1466.1 15461.9 2699.38
9 2011-09-30 1482.1 15611.8 2723.44
10 2011-12-31 1545.1 15818.7 2756.97
11 2012-03-31 1724.9 16041.6 2794.10
12 2012-06-30 1730.3 16160.4 2843.53
13 2012-09-30 1769.4 16356.0 2877.61
14 2012-12-31 1796.4 16420.3 2924.32
15 2013-03-31 1784.8 16535.3 2969.45
16 2013-06-30 1821.4 16661.0 3012.29
17 2013-09-30 1868.7 16912.9 3057.07