The SASEFRED Interface Engine

Example 48.1 Retrieving Data for Multiple Time Series

This example shows how to use multiple time series IDs to retrieve the average balance of payment basis data for the exports (BOPXGS) and imports (BOPMGS) of goods and services for the last 15 years, starting 1997-01-01 and ending 2011-01-01, with an annual frequency.

title 'Retrieve Balance of Payment Data for the Exports and Imports';
libname _all_ clear;

libname fred sasefred "%sysget(FRED)"
   OUTXML=fredex01
   AUTOMAP=replace
   MAPREF=MyMap
   XMLMAP="%sysget(FRED)fredex01.map"
   APIKEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
   IDLIST='bopxgs,bopmgs'
   START='1997-01-01'
   END='2011-01-01'
   FREQ='a'
   OUTPUT=1
   AGG='avg'
   FORMAT=xml;

data export_import;
   set fred.fredex01 ;
run;
proc contents data=export_import; run;
proc print data=export_import; run;

Output 48.1.1: Retrieve Balance of Payment Data for the Exports and Imports

Retrieve Balance of Payment Data for the Exports and Imports

Obs date realtime_start realtime_end BOPXGS BOPMGS
1 1997-01-01 2015-03-19 2015-03-19 233.614 -260.682
2 1998-01-01 2015-03-19 2015-03-19 233.293 -274.829
3 1999-01-01 2015-03-19 2015-03-19 241.824 -306.479
4 2000-01-01 2015-03-19 2015-03-19 268.064 -361.193
5 2001-01-01 2015-03-19 2015-03-19 250.634 -341.011
6 2002-01-01 2015-03-19 2015-03-19 243.652 -348.391
7 2003-01-01 2015-03-19 2015-03-19 254.367 -377.839
8 2004-01-01 2015-03-19 2015-03-19 289.490 -441.961
9 2005-01-01 2015-03-19 2015-03-19 320.775 -499.336
10 2006-01-01 2015-03-19 2015-03-19 363.212 -553.641
11 2007-01-01 2015-03-19 2015-03-19 412.059 -588.403
12 2008-01-01 2015-03-19 2015-03-19 458.632 -635.814
13 2009-01-01 2015-03-19 2015-03-19 393.685 -489.628
14 2010-01-01 2015-03-19 2015-03-19 462.232 -585.896
15 2011-01-01 2015-03-19 2015-03-19 530.359 -667.515