MATLAB: How to obtain the FactSet field properties in Datafeed Toolbox 2.0 (R2007a)

Datafeed Toolbox

I am looking for something similar to the 'bbfields.mat' field names in the Bloomberg API.

Best Answer

To retrieve the various field names in FACTSET, you should use the syntax:
f = factset(username,1234,password,fsid)
d = fetch(f)
which returns an output similar to the following:
d =
Group: [24x1 double]
Message: {24x1 cell}
Description: {24x1 cell}
Count: [24x1 double]
'd.Message' contains the library identification. For instance:
d.Message
returns:
ans =
'ca'
'cm'
'cq'
'demo'
'f'
'fm'
'fs'
'g'
'gics'
'i'
'ibes'
'ic'
'ica'
'icq'
'id'
'ih'
'ison'
'ms'
'msci'
'msd'
'msm'
'p'
'wq'
'ws'
This maps to the 'd.Description' field:
d.Description
ans =
'COMPUSTATAnnual-U.S.CompanyFinancialData'
'COMPUSTATMonthly(PDE)-U.S.SecurityPriceData'
'COMPUSTATQuarterly-U.S.CompanyFinancialData'
'DemoFormulas'
'FactSetCOMPUSTAT-DataforU.S.Companies'
'FASTFactSetMonthlyCalcsLibrary'
'FASTFactSetSecurityCalcsLibrary'
'FactSetCOMPUSTAT/Worldscope-GlobalData'
'FactSetGICSMulti-Sourced'
'FactSetWorldscope-DataforGlobalCompanies'
'FASTIbesCalcsLibrary'
'I/B/E/SEst-GlobalEstimateData-Current'
'I/B/E/SConsensus-GlobalEstimateData-Annual'
'I/B/E/SConsensus-GlobalEstimateData-Qtrly'
'I/B/E/SDetail-GlobalEstimateData'
'I/B/E/SEst-GlobalEstimateData-Monthly'
'FactSetISONIndexFunctions'
'FASTMsciSecurityDCalcsLibrary'
'MSCIGlobalIndexandConstituents'
'FASTMsciSecurityDCalcsLibrary'
'FASTMsciSecurityMCalcsLibrary'
'FactSetPrices-SecurityPriceData'
'Worldscope-GlobalFinancialData-Quarterly'
'Worldscope-GlobalFinancialData'
To get the fields for the 'ca' library, use the FETCH command:
x = fetch(f,'ca')
x =
index: {521x1 cell}
id: {521x1 cell}
type: {521x1 cell}
For instance, 'x.id(1)' returns the field 'RA:
To use the 'RA' field with,say, the IBM security, the syntax would be as follows:
y = fetch(f,'ibm','ca RA')
meaning that you're looking for the field 'RA' from the library 'ca' for IBM. Note that this may not be valid for this particular security, but is the correct syntax. In many cases, the field without the library name can be used, but you will need to experiment with it.
For example, executing:
y = fetch(f,'ibm','price')
will return an end of day price for IBM.