The SASEXFSD Interface Engine

The LIBNAME libref SASEXFSD Statement

  • LIBNAME libref SASEXFSD 'physical-name' FACTLET=fact_factletname options;

The LIBNAME statement assigns a SAS library reference (libref) to the physical path of the directory of FactSet data files where the downloaded FactSet XML data are stored. Because the required 'physical name' argument specifies the location of the folder where your FactSet XML data reside, it should end in a backslash if you are in a Windows environment and a forward slash if you are in a UNIX environment.

FACTLET=fact_factletname specifies the FactSet factlet that you want to use to download your data. Choose one factlet from these possible values: ExtractEconData, ExtractFormulaHistory, ExtractDataSnapshot, ExtractBenchmarkDetail, ExtractOFDBItem, ExtractOFDBUniverse, and ExtractScreenUniverse. (See Table 44.1.)

For example, the following statements access the FactSet database for daily dividend yield data for IBM:

   LIBNAME myLib SASEXFSD 'physical-name' FACTLET==ExtractFormulaHistory 
      IDS='ibm' 
      ITEMS='FG_DIV_YLD'
      FREQ=d
      USER='username' 
      PASS='password';

After the libref is assigned, you can access the data items for the IDs (keys) from the requested factlet.

You can specify the following options in the LIBNAME libref SASEXFSD statement.

FACTLET=fact_factletname

Each factlet type has its own set of parameters (shown in Table 44.5 in the Factlet Options Table column), allowing flexibility and easy access to FactSet data. For more details about each factlet, refer first to the Factlet Description Section listed in Table 44.5. If you need more information, refer to the Online Assistant, page ID 16948. If the factlet is not listed on that page, then enter the factlet name in the search window of the Online Assistant to retrieve additional information about using the factlet.

Table 44.5: Summary of Factlet Options

Factlet Name

Factlet Description Section

Factlet Options Table

ExtractEconData

The ExtractEconData Factlet

Table 44.10

ExtractFormulaHistory

The ExtractFormulaHistory Factlet

Table 44.12

ExtractDataSnapshot

The ExtractDataSnapshot Factlet

Table 44.13

ExtractBenchmarkDetail

The ExtractBenchmarkDetail Factlet

Table 44.15

ExtractOFDBItem

The ExtractOFDBItem Factlet

Table 44.16

ExtractOFDUniverse

The ExtractOFDBUniverse Factlet

Table 44.17

ExtractScreenUniverse

The ExtractScreenUniverse Factlet

Table 44.18


IDS=fact_ids

specifies a list of FactSet IDs (entity identifiers or keys) for accessing FactSet OnDemand data. To select more than one ID, list the unique entity identifiers, separated by commas (as shown in the following statements). Examples of FactSet IDs include CUSIPs, tickers, SEDOLs, Quick Code, and CINS (CUSIP International Numbering System). For more information, see Example 44.6 and Example 44.7.

   LIBNAME myLib sasexfsd 'physical-name' 
      ids='IBM,MSFT' 
      ITEMS='p_price,p_volume,ca_sales'; 
ITEMS='fact_itemlist'

specifies the items and groups of interest for selection based on IDs (keys). Use FactSet’s Formula Lookup for a complete list of data items, which is described in the FactSet Online Assistant.

Because the availability of data libraries and their contents are constantly changing, the following tables are included for instructional purposes only. Many other databases are available that are not shown in Table 44.6 to Table 44.9.

Table 44.6: Some FactSet Data Items

Data Source

Table Reference

Online Assistant Page ID

FactSet Fundamentals Data Items

Table 44.7

Page ID 15099

FactSet Global Formula Library

Also see Online Assistant Sidebar

Page IDs 13299, 16664

FactSet Global Indices Formulas

Table 44.8

Page ID 14336

Global Constituents Formulas

Table 44.9

Page ID 15086


Table 44.7: Some FactSet Fundamentals Data Items

Data Source

Online Assistant Page ID

Consolidated Items (FF_)

Page ID 16331

Debt Capital Structure

Page ID 16235

Enhancements to Legacy Formulas

Page ID 16248

Annual Items (FA_)

 

Balance Sheet

Page ID 15120

Income Statement

Page ID 15121

Funds Flow Statement

Page ID 15122

Financial Ratios

Page ID 15123

Per Share and Valuation

Page ID 15124

Multiple Share Information

Page ID 15125

Accounting Policies and Methods

Page ID 15126

Segment Data

Page ID 15127

Monthly Items (FM_)

 

Monthly Data

Page ID 15128


Table 44.8: FactSet Global Indices Formulas

Data Source

Online Assistant Page ID

Using FG Indices Formulas

Page ID 14337

Database Descriptions for Global Indices

Page ID 14338


Table 44.9: Global Constituents Formulas

Global Constituents Formula

Items

Benchmark Constituent Classification

FG_CONST_CLASS

Benchmark Constituent Country

FG_CONST_COUNTRY

Benchmark Constituent Currency

FG_CONST_CURRENCY

Benchmark Constituent Date

FG_CONST_DATE

Benchmark Constituent Float Factor

FG_CONST_FLOAT_FACTOR

Benchmark Constituent Identifier

FG_CONST_IDENTIFIER

Benchmark Constituent Latest Update

FG_CONST_UPDATE

Benchmark Constituent Market Value

FG_CONST_MCAP

Benchmark Constituent Name

FG_CONST_NAME

Benchmark Constituent Price

FG_CONST_PRICE

Benchmark Constituent Shares

FG_CONST_SHARES

Benchmark Constituent Style Factor

FG_CONST_STYLE_FACTOR

Benchmark Constituent Total Return - 1 Day

FG_CONST_TRET_1D

Benchmark Constituent Valuation

FG_CONST_VALUATION

Benchmark Constituent Weights

FG_CONST_WEIGHT

Benchmark Constituents

FG_CONSTITUENTS


For more information, see the FactSet Online Assistant, page ID 1931. To see each data source’s list of available data items, use the search feature of the FactSet Online Assistant. You can open any page in the FactSet Online Assistant by entering the appropriate page ID number in the page ID window, which is located below the search window.

DATES=‘fact_startdate:fact_enddate:fact_freqcode’

specifies the start date, end date, and frequency, separated by colons (:). For more information, see the section Specifying Date Ranges and Frequency Codes. An alternative to using the DATES= option is to use the START=, END=, and FREQ= options.

PERIOD=fact_period

specifies the periodic frequencies of the actual data points (observations) in a time series. The valid period parameters are ANN, QTR, SEMI, MON, YTD, YTD_SEMI, LTM, LTM_SEMI, and SEMI-ANN. The default is ANN.

OUTXML=fact_xmlfile

specifies the filename of the data file where the XML data that are returned from the FactSet OnDemand service are stored. You can use the OUTXML= option to name your XML data file, which is placed in the folder designated by ‘physical-name’, as shown in the section The LIBNAME libref SASEXFSD Statement.

AUTOMAP=fact_automap

specifies whether to overwrite the existing XML map file (AUTOMAP=REPLACE) or whether not to overwrite the existing XML map file (AUTOMAP=REUSE). You can set fact_automap to REUSE so that a pre-existing XML map named by the XMLMAP= option is used. You can set fact_automap to REPLACE so that the most current XML map generated by the SASEXFSD engine and named by the XMLMAP= option is used.

XMLMAP=fact_xmlmapfile

specifies the fully qualified name of the file where the XML map is automatically stored.

MAPREF=fact_xmlmapref

specifies the fileref to be used for the map assignment.

You can use the MAPREF= and XMLMAP= options to control where the map resides, what you name the map, and how you refer to it with a fileref. You can use the OUTXML= option to name your XML data file. This file is placed in the folder designated by ‘physical-name’, and you can reference it by using the myLib libref in your SASEXFSD LIBNAME statement. This is shown in the section Getting Started: SASEXFSD Interface Engine. The following filename statement is generated by the SASEXFSD interface engine by using the fileref, MyMap, from the MAPREF=MyMap option and from the fully designated filename in the XMLMAP= option:

   FILENAME MyMap "U:\factset\test\gstart1.map"; 
FORMAT=fact_xmlformat

specifies the SAS XML (SML) format, which is the only format that the SASEXFSD engine supports.

ORIENTATION=fact_xmlorient

specifies the ETI orientation, which is the only orientation that the SASEXFSD engine supports. The ETI orientation means that the data are returned and stored in entity-time-item logical layout.

USERNAME='fact_username'

specifies the FactSet user name that enables you to access the data provided by the FactSet OnDemand service.

PASS='fact_password'

specifies the password that is paired with the user name to enable you to access the data provided by the FactSet OnDemand service. Note: These FactSet OnDemand user name and password credentials are different from your FactSet workstation login credentials. A FactSet representative can provide these credentials.