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 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 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 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 5: Summary of Factlet Options

Factlet Name Factlet Description Section Factlet Options Table
ExtractEconData The ExtractEconData Factlet Table 10
ExtractFormulaHistory The ExtractFormulaHistory Factlet Table 12
ExtractDataSnapshot The ExtractDataSnapshot Factlet Table 13
ExtractBenchmarkDetail The ExtractBenchmarkDetail Factlet Table 15
ExtractOFDBItem The ExtractOFDBItem Factlet Table 16
ExtractOFDUniverse The ExtractOFDBUniverse Factlet Table 17
ExtractScreenUniverse The ExtractScreenUniverse Factlet Table 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 56.6 and Example 56.7.

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

UNIVERSE=fact_uni

specifies the universe of securities that passes the specified screening criteria. Up to 500 securities can be returned when this option is specified together with the FACTLET=ExtractFormulaHistory option. This limit is due to the US_UNIV function that is used within the ExtractFormulaHistory factlet to fetch the universe. You can also specify this option together with the FACTLET=ExtractDataSnapshot option, but because the data that are returned as of one specified date, there is no limit on the number of securities that can be returned.

LIBNAME myLib sasexfsd 'physical-name'
   factlet=ExtractFormulaHistory
   universe="URANKX((FS_PARENT_EQUITY=CUSIP AND EC_MKT_CAP(0,'CUR=USD')>10
      AND P_PRICE(0,USD)>5 AND CONTAINS(P_EXCOUNTRY,'UNITED STATES'))=1,
      EC_MKT_CAP(0,'CUR=USD'))<=500S"
   items='p_price(0,-4,M)';

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 6 to Table 9.

Table 6: Some FactSet Data Items

Data Source Table Reference Online Assistant Page ID
FactSet Fundamentals Data Items Table 7 Page ID 15099
FactSet Global Formula Library Also see Online Assistant Sidebar Page IDs 13299, 16664
FactSet Global Indices Formulas Table 8 Page ID 14336
Global Constituents Formulas Table 9 Page ID 15086


Table 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 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 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.

DEBUG=ON | OFF

specifies whether or not to include diagnostic message logging in the SAS log window. This information can be very useful for troubleshooting a problem.

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 name of both the XML file (downloaded from the FactSet OnDemand service) and the SAS data set created when the XML data are read into SAS. You can use the OUTXML= option to name your XML data file, which is placed in the current working directory. By default, OUTXML=FAST, which creates a file named FAST1.xml in the current working directory. The SAS data set created when the XML data are read into SAS is placed in the folder specified by the physical path in 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. These data are read into SAS and placed in a SAS data set in the folder designated by "physical-name", and you can reference the data 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 opti

on and from the fully designated file name in the XMLMAP= option:

FILENAME MyMap "%sysget(FACTSET)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.

PROXY="fact_proxyserver"

specifies which proxy server to use. This option is not required. The specified proxy server is used only when a connection-refused error or a connection-timed-out error occurs. For fact_proxyserver, specify the server’s HTTP address followed by a colon and the port number, and enclose that string in double quotation marks; for example, PROXY="http://inetgw.unx.sas.com:8118". See also the CONNECT= option.

CONNECT=ON | OFF

specifies whether or not to use the connect method along with the PROXY= option. Note: You must use the PROXY= option and specify your proxy server in addition to the CONNECT=ON option when you want to use the connect method. For more information about a secure connection, see the PROXY= option.

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.

Last updated: June 19, 2025