(View the complete code for this example.)
This example shows how to use the ExtractDataSnapshot factlet to extract multiple screen items (price and sales) as of a single date for multiple companies (in this case IBM and Microsoft) for the quarterly estimate period (PERIOD=QTR).
options validvarname=any;
title 'Retrieve Multiple Screen Items for Multiple Companies';
libname _all_ clear;
libname xfsd sasexfsd "%sysget(FACTSET)"
debug=on
factlet=ExtractDataSnapshot
ids='ibm,msft'
items='p_price,ff_sales'
dates='20110401'
period=QTR
format=sml
outXml=fsdex05
automap=replace
mapref=MyMap
xmlmap="%sysget(FACTSET)fsdex05.map"
orientation=eti
user='XXXXXXXXXXXXXXXX'
pass='XXXXXXXXXXXXXXXX';
data snapshot; set xfsd.fsdex05; run;
proc print data=snapshot; run;
Output 56.9.1: Multiple Screen Items for Multiple Companies
| Retrieve Multiple Screen Items for Multiple Companies |
| Obs | FQL_ENTITY | date | p_price | ff_sales |
|---|---|---|---|---|
| 1 | ibm | 04-01-2011 | 164.270 | 24607 |
| 2 | msft | 04-01-2011 | 25.480 | 16428 |