The SASEXFSD Interface Engine

Example 44.12 Retrieving Benchmark Data by Using the MATCHDATE= Option

This example shows how to use the ExtractBenchmarkDetail factlet to retrieve data from the Prices database for the Russell 1000 constituents (R.1000).

title 'Retrieve Benchmark Data for R.1000 with MATCHDATE=ON';
libname _all_ clear;

libname fsd sasexfsd "%sysget(FACTSET)"
   factlet=ExtractBenchmarkDetail
   ids='r.1000'
   items='p_price'
   dates='20120118:20120113:b'
   matchDate=on
   format=sml
   outXml=fsdex13
   automap=replace
   mapref=MyMap
   xmlmap="%sysget(FACTSET)fsdex13.map"
   orientation=eti
   user='XXXXXXXXXXXXXXXX'
   pass='XXXXXXXXXXXXXXXX';

data benchmatch;
   set fsd.fsdex13;
run;
proc print
   data=benchmatch(firstobs=1 obs=50);
run;

If the frequency argument were not set to B (indicating business days) and the MATCHDATE= option were not turned on, the output would contain repetitive dates because of feel-back, resulting in unnecessarily lengthy output.

Output 44.12.1: Retrieving Benchmark Data for the Russell 1000 Index by Using the MATCHDATE=ON Option

Retrieve Benchmark Data for R.1000 with MATCHDATE=ON

Obs FQL_ENTITY date SECURITY_ID Weight p_price
1 R.1000 01-17-2012 30231G10 3.17717 85.690
2 R.1000 01-17-2012 03783310 2.95608 424.700
3 R.1000 01-17-2012 45920010 1.64095 180.000
4 R.1000 01-17-2012 16676410 1.61489 106.720
5 R.1000 01-17-2012 59491810 1.57846 28.255
6 R.1000 01-17-2012 36960410 1.49591 18.740
7 R.1000 01-17-2012 74271810 1.39208 66.260
8 R.1000 01-17-2012 00206R10 1.34835 30.250
9 R.1000 01-17-2012 47816010 1.34355 65.120
10 R.1000 01-17-2012 71708110 1.30536 21.935
11 R.1000 01-17-2012 38259P50 1.19073 628.580
12 R.1000 01-17-2012 94974610 1.10366 29.825
13 R.1000 01-17-2012 46625H10 1.04412 34.910
14 R.1000 01-17-2012 08467070 1.02732 77.970
15 R.1000 01-17-2012 71817210 1.01597 75.900
16 R.1000 01-17-2012 19121610 1.00150 33.675
17 R.1000 01-17-2012 45814010 0.99967 25.040
18 R.1000 01-17-2012 58933Y10 0.90210 38.820
19 R.1000 01-17-2012 92343V10 0.83088 39.020
20 R.1000 01-17-2012 68389X10 0.79993 27.660
21 R.1000 01-17-2012 17275R10 0.79941 19.305
22 R.1000 01-17-2012 93114210 0.79937 59.850
23 R.1000 01-17-2012 58013510 0.78525 100.550
24 R.1000 01-17-2012 71344810 0.76915 64.650
25 R.1000 01-17-2012 74752510 0.71803 57.140
26 R.1000 01-17-2012 20825C10 0.70754 70.800
27 R.1000 01-17-2012 80685710 0.69083 67.640
28 R.1000 01-17-2012 00282410 0.65197 55.710
29 R.1000 01-17-2012 17296742 0.61791 28.215
30 R.1000 01-17-2012 67459910 0.60755 99.300
31 R.1000 01-17-2012 25468710 0.54744 38.480
32 R.1000 01-17-2012 91301710 0.53072 77.040
33 R.1000 01-17-2012 20030N10 0.52974 25.535
34 R.1000 01-17-2012 43707610 0.52612 43.740
35 R.1000 01-17-2012 14912310 0.50160 103.370
36 R.1000 01-17-2012 02313510 0.49686 181.660
37 R.1000 01-17-2012 06050510 0.49422 6.480
38 R.1000 01-17-2012 60920710 0.47423 38.130
39 R.1000 01-17-2012 02209S10 0.45520 28.900
40 R.1000 01-17-2012 88579Y10 0.45049 84.230
41 R.1000 01-17-2012 03116210 0.45029 68.070
42 R.1000 01-17-2012 91324P10 0.43685 53.570
43 R.1000 01-17-2012 12665010 0.43416 42.540
44 R.1000 01-17-2012 11012210 0.43298 33.720
45 R.1000 01-17-2012 09702310 0.41809 75.240
46 R.1000 01-17-2012 90297330 0.41721 28.770
47 R.1000 01-17-2012 91131210 0.41034 74.200
48 R.1000 01-17-2012 90781810 0.40428 109.500
49 R.1000 01-17-2012 92826C83 0.40357 102.530
50 R.1000 01-17-2012 02581610 0.39715 50.220