The SASEFRED Interface Engine

Example 39.2 Retrieving Data by Using the Vintage Date

This example shows how to use the vintage date to retrieve data for exports of goods and services as they existed on that specific date in history. OUTPUT=3 retrieves the new and revised observations only, by the vintage date (VINTAGE=2012-06-14). If OUTPUT=3, then you must specify UNITS=‘lin’. In this example, the UNITS= option is not specified, so it assumes its default value, which is ‘lin’. Specifying a different argument for the UNITS= option (such as ‘chg’) is invalid for OUTPUT= 3, so ’chg’ is replaced by the default value (‘lin’).

title 'Retrieve Data for the Exports of Goods and Service by Using Vintage Date';
libname _all_ clear;

libname fred sasefred "%sysget(FRED)"
   OUTXML=fredex02
   AUTOMAP=replace
   MAPREF=MyMap
   XMLMAP="%sysget(FRED)fredex02.map"
   APIKEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
   IDLIST='bopxgsa'
   VINTAGE='2012-06-14'
   OUTPUT=3
   FORMAT=xml;

data export_vin;
   set fred.fredex02 ;
run;
proc contents data=export_vin; run;
proc print data=export_vin; run;

Output 39.2.1: Retrieve Data for the Exports of Goods and Services by Using the Vintage Date

Retrieve Data for the Exports of Goods and Service by Using Vintage Date

Obs date BOPXGSA_20120614
1 2009-01-01 1578.95
2 2010-01-01 1842.49
3 2011-01-01 2103.37