This simple example shows how to use the ExtractFormulaHistory factlet to retrieve price data for one company (in this case IBM).
title 'Retrieve Price Data for IBM'; libname _all_ clear; libname xfsd sasexfsd "%sysget(FACTSET)" factlet=ExtractFormulaHistory ids='ibm' items='p_price' dates='20110130:20111231:m' format=sml outXml=fsdex01 automap=replace mapref=MyMap xmlmap="%sysget(FACTSET)fsdex01.map" orientation=eti user='XXXXXXXXXXXXXXXX' pass='XXXXXXXXXXXXXXXX'; data recentprice; set xfsd.fsdex01; run; proc print data=recentprice; run;
Output 43.6.1: Price Data for IBM
Retrieve Price Data for IBM |
Obs | FQL_Entity | date | p_price |
---|---|---|---|
1 | ibm | 01-31-2011 | 162.000 |
2 | ibm | 02-28-2011 | 161.880 |
3 | ibm | 03-31-2011 | 163.070 |
4 | ibm | 04-30-2011 | 170.580 |
5 | ibm | 05-31-2011 | 168.930 |
6 | ibm | 06-30-2011 | 171.550 |
7 | ibm | 07-31-2011 | 181.850 |
8 | ibm | 08-31-2011 | 171.910 |
9 | ibm | 09-30-2011 | 174.870 |
10 | ibm | 10-31-2011 | 184.630 |
11 | ibm | 11-30-2011 | 188.000 |
12 | ibm | 12-31-2011 | 183.880 |