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 50.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 50.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 | 1273.2 | 14384.1 | 2579.33 |
2 | 2009-12-31 | 1374.4 | 14566.5 | 2552.82 |
3 | 2010-03-31 | 1450.2 | 14681.1 | 2538.11 |
4 | 2010-06-30 | 1436.8 | 14888.6 | 2521.93 |
5 | 2010-09-30 | 1499.1 | 15057.7 | 2522.83 |
6 | 2010-12-31 | 1494.5 | 15230.2 | 2647.43 |
7 | 2011-03-31 | 1350.2 | 15238.4 | 2675.63 |
8 | 2011-06-30 | 1423.1 | 15460.9 | 2698.16 |
9 | 2011-09-30 | 1430.4 | 15587.1 | 2724.73 |
10 | 2011-12-31 | 1507.1 | 15785.3 | 2755.94 |
11 | 2012-03-31 | 1669.7 | 15956.5 | 2794.03 |
12 | 2012-06-30 | 1645.9 | 16094.7 | 2842.45 |
13 | 2012-09-30 | 1715.1 | 16268.9 | 2879.68 |
14 | 2012-12-31 | 1694.6 | 16332.5 | 2923.61 |
15 | 2013-03-31 | 1694.1 | 16502.4 | 2968.36 |
16 | 2013-06-30 | 1760.7 | 16619.2 | 3009.08 |
17 | 2013-09-30 | 1803.4 | 16872.3 | 3025.16 |