Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter Twenty-oneEDGARView Integration (continued)

EDGARLookupCIK Function

Overview

The EDGARLookupCIK function accesses the SEC’s public-facing company database and returns an array with basic information for the specified CIK.

Syntax/Parameters

Syntax

string[] = EDGARLookupCIK ( string cik | qword cik );

Parameters

cik

A string or a qword that specifies the registrant CIK to retrieve. Note that EDGAR CIK values can exceed a 32-bit integer or dword size. If providing a string, the CIK need not be zero leading.

Return Value

A string array containing data from the SEC. On failure, the array will be empty. Use the GetLastError function to return details of the error.

If the CIK cannot be located (but a connection was made to the SEC), the last error will be ERROR_EOD.

If there is an issue with the content of the response, ERROR_SYNTAX with a low word code will be returned. Contact technical support if this error is returned since it can indicate that the SEC has changed its response format.

Remarks

The information returned by this function is the same as the public-facing company database. Note that this information can differ slightly from the private access company database, specifically in the area of the address since the SEC stores multiple types of addresses.

Each entry within the returned list will have one of the following key names:

  Name   Description  
  General Information      
    CompanyName   Company name.  
    CIK   Company CIK (matches requested value but will be zero filled).  
    IRSNumber   IRS Number on file.  
    FileNumber   Primary File Number. Note that some entities may have multiple file numbers.  
    EntityType   Regulated entity type.  
    SIC   Standing Industrial Classification Code.  
    Address   A combined address in the form of 2 lines and a third address line containing city, state, zip or foreign postal information. The lines are separated by a CR (0x0D) character. There is no fixed format.  
    PhoneNumber   Phone number.  
    SOI   State of Incorporation. Unlike other EDGAR values, this is spelled out and not a code.  
    FYE   Fiscal Year End.  
    LastUpdate   Date the last time the record was updated.  
    SeriesList   If the CIK has series/class information associated, this entry will contain a list of all the series ID codes separated by spaces.  
  Series and Class      
    S000000000_ID   The series ID where “S000000000” is the matching series ID. Each partial key component will be in the series list. There will be matching items for each of the fives suffixes, including this one, for each series in the SeriesList.  
    S000000000_Name   The name of the series.  
    S000000000_Status    The status of the series. This is normally ‘Active’ or ‘Inactive’.  
    S000000000_Classes    A list of the class ID codes attached to the series.  
    S000000000_C000000000_ID   The class ID where “C000000000” is the class ID and “S00000000” is the series ID. For each class, the series ID and class ID are combined with a suffix.  
    S000000000_C000000000_Name   The name of the class.  
    S000000000_C000000000_Ticker   Ticker symbol/name for the class.  
    S000000000_C000000000_Status   The status of the class. This is normally ‘Active’ or ‘Inactive’.  

 

For certain investment companies, the array can be very large. Programmers should consider using an auto-allocated array since the number of list entries may vary.

An example of reading a random fund with series and class information (any valid CIK can be used, so illustrate series and class data, pick a CIK for an investment company with one or more series):

    string              list[];
    string              cik;
    string              s1;
    int                 ix, size;
    int                 rc;

    cik = "0000355916";

    list = EDGARLookupCIK(cik);
    if (IsError()) {
      rc = GetLastError();
      AddMessage("CIK Not found %s, 0x%08X", cik, rc);
      exit;
      }

    size = ArrayGetAxisDepth(list);

    while (ix < size) {
      s1 = ArrayGetKeyName(list, ix);
      AddMessage("%3d - %-30s : %s", ix, s1, list[ix]);
      ix++;
      }

This will result in a fairly long list of data, some of it presented in the log below:

  0 - CompanyName                    : BlackRock Variable Series Funds, Inc.
  1 - CIK                            : 0000355916
  2 - IRSNumber                      : 133093080
  3 - FileNumber                     : 811-03290
  4 - EntityType                     : 
  5 - SIC                            : 0000
  6 - Address                        : 100 BELLEVUE PARKWAY WILMINGTON, DELAWARE 19809
  7 - PhoneNumber                    : 800-441-7762
  8 - SOI                            : MARYLAND
  9 - FYE                            : 1231
 10 - LastUpdate                     : 05/19/08
 11 - SeriesList                     : S000002874 S000002875 S000002876 S000002877 S000002878 ...
 12 - S000002874_ID                  : S000002874
 13 - S000002874_Name                : BlackRock Managed Volatility V.I. Fund 
 14 - S000002874_Status              : Active
 15 - S000002874_Classes             : C000007899 C000007900 C000007901
 16 - S000002874_C000007899_ID       : C000007899
 17 - S000002874_C000007899_Name     : Class I
 18 - S000002874_C000007899_Ticker   : 
 19 - S000002874_C000007899_Status   : Active
 20 - S000002874_C000007900_ID       : C000007900
 21 - S000002874_C000007900_Name     : Class II
 22 - S000002874_C000007900_Ticker   : 
 23 - S000002874_C000007900_Status   : Active
 24 - S000002874_C000007901_ID       : C000007901
 25 - S000002874_C000007901_Name     : Class III
 26 - S000002874_C000007901_Ticker   : 
 27 - S000002874_C000007901_Status   : Active
     ...

Note that array index 11 (do not rely on fixed indices) has the list of the series IDs which has been truncated in this example. Each of those IDs can be used to build key names to access the series data. In addition, each series has a class list, as shown at index 15, these IDs can be combined with the related series ID to build key names for the class data.

To create an array of series or class IDs, use the ExplodeString function.

The company database operates outside of EDGAR operation hours and is normally available on a 24/7 basis.

When performing multiple searches where the same information may be requested, it is a good idea to locally cache the data retrieved to avoid constant web page scraping. For example:

    string              cik_list[100][2];                 // Global Cache of CIK Names

string get_cik_name(string ss) {                          // Look Up CIK's Name                   

    string              data[];
    int                 ix;

    ix = FindInTable(cik_list, ss);
    if (IsNotError(ix)) {
      return cik_list[ix][1];
      }
    data = EDGARLookupCIK(ss);
    if (IsError()) {
      return "";
      }
    ix = ArrayGetAxisDepth(cik_list, AXIS_ROW);
    if (ix < 100) {
      cik_list[ix][0] = ss;
      cik_list[ix][1] = data["CompanyName"];
      }
    return data["CompanyName"];
    }

Repeatedly calling with the same CIK will not likely pound the SEC’s server since both the application and WinInet will cache pages. Further, if changes are made to the SEC database, they are not likely to quickly appear when referenced from the EDGARLookupCIK function.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic

Page revised 2024-10-21