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 or a forward slash if you are in a UNIX environment.
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 SASEXFSD LIBNAME statement.
specifies the FactSet factlet that you want to use to download your data. Choose one factlet from the possible values: ExtractFormulaHistory, ExtractDataSnapshot, ExtractOFDBItem, ExtractOFDBUniverse, ExtractScreenUniverse, and ExtractEconData (supports only the FactSet Standardized Economic database). (See Table 43.1.) Each factlet type has its own set of parameters, shown in the Factlet Options Table column in Table 43.5, which allow flexibility and easy access to FactSet data. For more details about each factlet, see the Factlet Description Section column in Table 43.5. If you need more information, see page ID 16948 in the FactSet Online Assistant. If the factlet is not listed there, enter the factlet name in the search window of the FactSet Online Assistant to get additional information about using the factlet.
Table 43.5: Summary of Factlet Options
Factlet Name |
Factlet Description Section |
Factlet Options Table |
---|---|---|
ExtractFormulaHistory |
||
ExtractDataSnapshot |
||
ExtractOFDBItem |
||
ExtractOFDUniverse |
||
ExtractScreenUniverse |
||
ExtractEconData |
specifies a list of FactSet IDs (entity identifiers or keys) for accessing FactSet OnDemand data. To select more than one ID, list each unique entity identifier followed by a comma (as shown in the following statements). FactSet IDs include CUSIPs, TICKERs, SEDOLs, Quick Codes, or CINS (CUSIP International Numbering System). See Example 43.1 for more details.
LIBNAME myLib sasexfsd 'physical-name' ids='IBM,MSFT' ITEMS='p_price,p_volume,ca_sales';
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. The list in Table 43.6 is described in the FactSet Online Assistant. SAS 9.3 supports only the data items that return numeric values.
Because the availability of data libraries and their contents are constantly changing, Table 43.6 to Table 43.9 are included for demonstration only. Many other databases are available that are not shown in these tables.
Table 43.6: Some FactSet Data Items
Data Source |
Table Reference |
Online Assistant Page ID |
---|---|---|
FactSet Fundamentals Data Items |
15099 |
|
FactSet Global Formula Library |
See also FactSet Sidebar |
13299, 16664 |
FactSet Global Indices Formulas |
14336 |
|
Global Constituents Formulas |
15086 |
Table 43.7: Some FactSet Fundamentals Data Items
Data Source |
Online Assistant Page ID |
---|---|
Consolidated Items (FF_) |
16331 |
Debt Capital Structure |
16235 |
Enhancements to Legacy Formulas |
16248 |
Annual Items (FA_) |
|
Balance Sheet |
15120 |
Income Statement |
15121 |
Funds Flow Statement |
15122 |
Financial Ratios |
15123 |
Per Share and Valuation |
15124 |
Multiple Share Information |
15125 |
Accounting Policies and Methods |
15126 |
Segment Data |
15127 |
Monthly Items (FM_) |
|
Monthly Data |
15128 |
Table 43.8: FactSet Global Indices Formulas
Data Source |
Online Assistant Page ID |
---|---|
Using FG Indices Formulas |
14337 |
Database Descriptions for Global Indices |
14338 |
Table 43.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 page ID 1931 of the FactSet Online Assistant. To see each data source’s list of available data items, use the search feature of the Online Assistant. You can view any page from the Online Assistant by entering its page ID in the page ID window shown just below the search window.
specifies the start date, end date, and frequency separated by colons (:). See Specifying Date Ranges and Frequency Codes. An alternative to using the DATE= option is to use the START=, END=, and FREQ= options.
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.
specifies the complete physical filename of the XML data file. You generate it by requesting the SAS XML (SML) data format from the FactSet OnDemand service.
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 specified 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 specified by the XMLMAP= option is used.
specifies the fully qualified name of the file where the XML map is automatically stored.
specifies the fileref used for the map assignment. See the section Getting Started: SASEXFSD Interface Engine for an example of the SASEXFSD engine that uses the MAPREF= and XMLMAP= options in the FILENAME statement to assign a filename, as in the following:
FILENAME MyMap "U:\factset\test\gstart1.map";
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. It 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 inside the DATA step in the SET statement, which names the input data set myLib.gstart1 and causes the reading of the gstart1.xml file to be input and stored in a SAS data set named Company_pvol.
specifies the SAS XML (SML) format, which is the only format that the SASEXFSD engine supports.
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.
specifies the FactSet user name that enables you to access the data provided by the FactSet OnDemand service.
specifies the password that is paired with the user name that enables you to access the data provided by the FactSet OnDemand service. Note: These FactSet OnDemand service credentials are different from your FactSet workstation login credentials. A FactSet representative can provide both sets of credentials.