Resources

Retrieving Items Using SPEC_ID

/*----------------------------------------------------------------

                   SAS SAMPLE LIBRARY

       Name: fsdex14.sas
Description: Example program from SAS/ETS User's Guide,
             The SASEXFSD Interface Engine
      Title: Retrieving Items Using SPEC_ID
    Product: SAS/ETS Software
       Keys: FactSet data extraction
      Procs: SASEXFSD
      Notes: Read this before you run this sample.
             The sample data provided resides in the ets/sasmisc folder.
             If you are using automap=READONLY, then you must copy the
             map of your incoming XML data to a writeable folder before
             using it. So, define a Windows system environment variable
             ,FACTSET, to the path of your  writeable folder containing
             the fsdecon14.map file and FSDECON14.xml file.
             To assign a fileref to the external file to be processed,
             use the following form of the libname statement:

           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='<your FactSet username for internet FASTfetch access>'
              pass='<your FactSet password for internet FASTfetch access>';
----------------------------------------------------------------*/

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;