This example shows how to use the ExtractEconData factlet and SPEC_ID_DATA to retrieve the WTI-FDS:FG_PRICE daily time series for the last 30 days by using the FQL economic download syntax. For more information about real-time data and specifying identifiers for commodity spot prices, see the FactSet Online Assistant, page ID 16992.
option validvarname=any; title 'Retrieve WTI-FDS:FG_PRICE Using SPEC_ID_DATA for the Last 30 Days'; libname _all_ clear; libname xfsd sasexfsd "%sysget(FACTSET)" factlet=ExtractEconData item="SPEC_ID_DATA('WTI-FDS:FG_PRICE',0,-30,d)" format=sml outXml=fsdecon14 automap=replace mapref=MyMap xmlmap="%sysget(FACTSET)fsdecon14.map" orientation=eti user='XXXXXXXXXXXXXXXX' pass='XXXXXXXXXXXXXXXX'; data WTIPrice; set xfsd.fsdecon14; run; proc print data=WTIPrice; run;
Output 44.4.1: Daily Series Using SPEC_ID_DATA for West Texas Intermediate Crude Oil Spot Price
Retrieve WTI-FDS:FG_PRICE Using SPEC_ID_DATA for the Last 30 Days |
Obs | FQL_Entity | date | spec_id_data WTI-FDS:FG_PRICE |
---|---|---|---|
1 | spec_id_data | 02-20-2013 | 94.4600 |
2 | spec_id_data | 02-21-2013 | 92.8400 |
3 | spec_id_data | 02-22-2013 | 93.1300 |
4 | spec_id_data | 02-25-2013 | 93.1100 |
5 | spec_id_data | 02-26-2013 | 92.6300 |
6 | spec_id_data | 02-27-2013 | 92.7600 |
7 | spec_id_data | 02-28-2013 | 92.0500 |
8 | spec_id_data | 03-01-2013 | 90.6800 |
9 | spec_id_data | 03-04-2013 | 90.1200 |
10 | spec_id_data | 03-05-2013 | 90.8200 |
11 | spec_id_data | 03-06-2013 | 90.4300 |
12 | spec_id_data | 03-07-2013 | 91.5600 |
13 | spec_id_data | 03-08-2013 | 91.9500 |
14 | spec_id_data | 03-11-2013 | 92.0600 |
15 | spec_id_data | 03-12-2013 | 92.5400 |
16 | spec_id_data | 03-13-2013 | 92.5200 |
17 | spec_id_data | 03-14-2013 | 93.0300 |
18 | spec_id_data | 03-15-2013 | 93.4500 |
19 | spec_id_data | 03-18-2013 | 93.7400 |
20 | spec_id_data | 03-19-2013 | 92.1600 |
21 | spec_id_data | 03-20-2013 | 92.9600 |
22 | spec_id_data | 03-21-2013 | 92.4500 |
23 | spec_id_data | 03-22-2013 | 93.7100 |
24 | spec_id_data | 03-25-2013 | 94.8100 |
25 | spec_id_data | 03-26-2013 | 96.3400 |
26 | spec_id_data | 03-27-2013 | 96.5800 |
27 | spec_id_data | 03-28-2013 | 97.2300 |
28 | spec_id_data | 03-29-2013 | 97.2300 |
29 | spec_id_data | 04-01-2013 | 97.0700 |
30 | spec_id_data | 04-02-2013 | 97.1900 |
31 | spec_id_data | 04-03-2013 | 94.4500 |