This example shows how to read data from a Quandl superset by using the Quandl code TAMMER1/6KY to retrieve oil, gold, and stock prices. This superset is described at the following URL: https://www.quandl.com/TAMMER1/6KY-GoldOil-Gold-and-Stocks .
There are three superset columns (Oil, Gold, and S&P500), taken from three different Quandl data sets: DOE/_RWTC, BBK01/_WT5511, and YAHOO/_INDEX_GSPC, respectively. Because the Oil, Gold, and S&P500 columns are all from a daily native frequency data set, you can use the collapse frequency "Annual" to minimize the missing values in the output. In the following example, specify a range by using START='1961-12-31' and END='2014-03-27', and specify a collapse frequency by using COLLAPSE=ANNUAL. The output is shown in Output 50.7.1.
options validvarname=any; title 'TAMMER1/6KY Superset with Multiple Time Series Using the COLLAPSE= Option'; libname _all_ clear; libname mylib "U:\quan950\doc\"; libname myTAM sasequan "%sysget(QUANDL)" apikey='XXXXXXXXXXXXXXXXXXXX' idlist='TAMMER1/6KY' format=XML outXml=superT automap=replace mapref=MyMap xmlmap="%sysget(QUANDL)superT.map" start='1961-12-31' end='2014-03-27' collapse=annual ; data mylib.superT; set myTAM.superT; run;
proc contents data=mylib.superT; run; proc print data=mylib.superT; run;
Output 50.7.1: Quandl Superset for Multiple Time Series (Oil, Gold, and Stocks) Using COLLAPSE= Option
TAMMER1/6KY Superset with Multiple Time Series Using the COLLAPSE= Option |
Obs | date | CAN_NY_GDP_MKTP_KD_ZG - Value |
BBK01_WT5511 - Value |
---|---|---|---|
1 | 2015-12-31 | . | 1195.50 |
2 | 2014-12-31 | . | 1199.25 |
3 | 2013-12-31 | 2.02202 | 1201.50 |
4 | 2012-12-31 | 1.70901 | 1664.00 |
5 | 2011-12-31 | 2.52818 | 1574.50 |
6 | 2010-12-31 | 3.37425 | 1410.25 |
7 | 2009-12-31 | -2.71147 | 1104.00 |
8 | 2008-12-31 | 1.17543 | 865.00 |
9 | 2007-12-31 | 2.00831 | 836.50 |
10 | 2006-12-31 | 2.62178 | 635.70 |
11 | 2005-12-31 | 3.16313 | 513.00 |
12 | 2004-12-31 | 3.13879 | 438.00 |
13 | 2003-12-31 | 1.92532 | 417.25 |
14 | 2002-12-31 | 2.80187 | 342.75 |
15 | 2001-12-31 | 1.68837 | 276.50 |
16 | 2000-12-31 | 5.12312 | 272.65 |
17 | 1999-12-31 | 4.99726 | 290.85 |
18 | 1998-12-31 | 4.13819 | 287.45 |
19 | 1997-12-31 | 4.25335 | 289.20 |
20 | 1996-12-31 | 1.67960 | 369.55 |
21 | 1995-12-31 | 2.73849 | 386.70 |
22 | 1994-12-31 | 4.55401 | 382.50 |
23 | 1993-12-31 | 2.60737 | 390.65 |
24 | 1992-12-31 | 0.85438 | 332.90 |
25 | 1991-12-31 | -2.12024 | 353.40 |
26 | 1990-12-31 | 0.12898 | 391.00 |
27 | 1989-12-31 | 2.37549 | 401.00 |
28 | 1988-12-31 | 4.73765 | 410.15 |
29 | 1987-12-31 | 4.04228 | 486.50 |
30 | 1986-12-31 | 2.19816 | 390.90 |
31 | 1985-12-31 | 4.67925 | 327.00 |
32 | 1984-12-31 | 5.57187 | 309.00 |
33 | 1983-12-31 | 2.56606 | 381.50 |
34 | 1982-12-31 | -3.02027 | 448.00 |
35 | 1981-12-31 | 3.50312 | 400.00 |
36 | 1980-12-31 | 2.16262 | 589.50 |
37 | 1979-12-31 | 3.80492 | 524.00 |
38 | 1978-12-31 | 3.95359 | 224.50 |
39 | 1977-12-31 | 3.45823 | 165.60 |
40 | 1976-12-31 | 5.19930 | 134.55 |
41 | 1975-12-31 | 1.82297 | 140.25 |
42 | 1974-12-31 | 3.69099 | 187.50 |
43 | 1973-12-31 | 6.96420 | 112.25 |
44 | 1972-12-31 | 5.44586 | 64.70 |
45 | 1971-12-31 | 4.11766 | 43.64 |
46 | 1970-12-31 | 7.65830 | 37.38 |
47 | 1969-12-31 | 5.26000 | 35.21 |
48 | 1968-12-31 | 5.29534 | 41.95 |
49 | 1967-12-31 | 2.91531 | . |
50 | 1966-12-31 | 6.58497 | . |
51 | 1965-12-31 | 6.63655 | . |
52 | 1964-12-31 | 6.69946 | . |
53 | 1963-12-31 | 5.18178 | . |
54 | 1962-12-31 | 7.11678 | . |
55 | 1961-12-31 | 3.16329 | . |