Resources

Retrieving Multiple Items/Companies Belonging to a Single OFDB File

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

                   SAS SAMPLE LIBRARY

       Name: fsdex07.sas
Description: Example program from SAS/ETS User's Guide,
             The SASEXFSD Interface Engine
      Title: Retrieving Multiple Items/Companies Belonging to a Single OFDB File
    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 system environment variable
             ,FACTSET, to the path of your  writeable folder containing
             the fsdex07.map file and FSDEX07.xml.
             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=ExtractOFDBItem
              ofdb='SASTESTING.OFDB'
              ids='ibm,msft'
              items='shares,price'
              dates='20120227:20120228:d'
              period=QTR
              format=sml
              outXml=fsdex07
              automap=replace
              mapref=MyMap
              xmlmap="%sysget(FACTSET)fsdex07.map"
              orientation=eti
              user='<your FactSet username for internet FASTfetch access>'
              pass='<your FactSet password for internet FASTfetch access>';
----------------------------------------------------------------*/

options validvarname=any
   sslcalistloc="/SASSecurityCertificateFramework/1.1/cacerts/trustedcerts.pem";

title 'Retrieve Shares and Price Data for IBM and MSFT from an OFDB File';
libname _all_ clear;

libname xfsd sasexfsd "%sysget(FACTSET)"
   debug=on
   factlet=ExtractOFDBItem
   ofdb='SASTESTING.OFDB'
   ids='ibm,msft'
   items='shares,price'
   dates='20120227:20120228:d'
   period=QTR
   format=sml
   outXml=fsdex07
   automap=replace
   mapref=MyMap
   xmlmap="%sysget(FACTSET)fsdex07.map"
   orientation=eti
   user='XXXXXXXXXXXXXXXX'
   pass='XXXXXXXXXXXXXXXX';

data shareOFDB; set xfsd.fsdex07; run;
proc print data=shareOFDB; run;