The SASEXFSD Interface Engine (Experimental)

Example 43.3 Retrieving Book Value Data for One Company by Using Relative Dates

This example shows how to use ExtractFormulaHistory factlet to retrieve book value data for one company (in this case Exxon Mobil, or XOM) by using relative dates. The book value represents the proportional common equity divided by outstanding shares at the end of the company’s fiscal year. The relative date specifies the date as $n$ periods ago based on the frequency (specified or implied); for example, DATES=0:-8:y returns data for nine years prior to the most recently updated year.

title 'Retrieve Book Value Data for Exxon Mobil (XOM) for the Last 9 Years';
libname _all_ clear;

libname xfsd sasexfsd "%sysget(FACTSET)"
   factlet=ExtractFormulaHistory
   ids='xom'
   items='ff_bps'
   dates='0:-8:y'
   format=sml
   outXml=fsdex03
   automap=replace
   mapref=MyMap
   xmlmap="%sysget(FACTSET)fsdex03.map"
   orientation=eti
   user='XXXXXXXXXXXXXXXX'
   pass='XXXXXXXXXXXXXXXX';

data bookRelative;
   set xfsd.fsdex03;
run;
proc print
   data=bookRelative;
run;

Output 43.3.1: Book Value Data for Exxon Mobil for the Last Nine Years

Retrieve Book Value Data for Exxon Mobil (XOM) for the Last 9 Years

Obs FQL_Entity date ff_bps
1 xom 12-31-2003 13.6899
2 xom 12-31-2004 15.8969
3 xom 12-31-2005 18.1291
4 xom 12-31-2006 19.8715
5 xom 12-31-2007 22.6239
6 xom 12-31-2008 22.7020
7 xom 12-31-2009 23.3910
8 xom 12-31-2010 29.4917
9 xom 12-31-2011 32.6143