U-034 ACCESSING COMPUSTAT DATA

INTRODUCTION

The Compustat II data files offer a library of financial, statistical, and market information covering several thousand industrial and nonindustrial companies. Copies of these files are available to ITC's Unix systems in Compustat's Universal Character format and are stored in the /net/public/compustat and /net/public/compustat.old directories.


ADDITIONAL DOCUMENTATION

A description of each Compustat data item can be found in the Compustat II manuals, available for reference through ITC's Research Computing Group (res-consult@virginia.edu), as well as at the Darden School and the School of Commerce. It is suggested that these manuals be consulted for definition of data items, treatment of missing data and other per- tinent information. It may also be advisable to consult the language reference guides for the language you are using, such as FORTRAN manuals, or the SAS Language Reference, both available at the ITC Help Desk in room 235 of Wilson Hall.


DATA AVAILABLE

The data in each Compustat data file is stored in arrays. Each array spans several logical records. The oldest information is found in the first part of the array and the most recent information is found in the last part of the array.


ACCESS

Two examples follow of how the Merged Industrial Annual dataset could be read, one using FORTRAN and one using SAS:

  1. FORTRAN - OPEN and READ statements

    
          open (unit=8,file='MIA',status='OLD',form='FORMATTED',
         .     access='SEQUENTIAL')
          read(8,100) DNUM,CNUM,CIC,REC,FILE,.....
      100 format(I4,A6,A3,I1,I2,.....
    
    

    where

    
       8   is a FORTRAN unit number. (See FORTRAN manuals for 
           acceptable unit numbers.)
    

    A sample FORTRAN program exists that will access the data in the annual data files. The program, a script for running it and documentation can be found in the directory /help/unix/financial/compustat. See the ``README'' file in that directory for more information.

  2. SAS - DATA step which reads in tape

         data anyset;
         infile miafile;
         input  @1 dnum i4.  @5 cnum $6.  @13 cic $3.  @17 rec i1.
                @21 file i2......
    

    where

    anyset  is a SAS dataset name. (See SAS manuals  for  information
            on setting up a data step and input statement in SAS.)
    


    WE REALLY WANT TO KNOW...
    Have you found this publication useful? Are there ways we might improve or supplement it or other ITC publications? Did you find this document in Web or in hard copy? We really want your opinion. Send e-mail to:  newsdesk@virginia.edu

    © 2008 by the Rector and Visitors of the University of Virginia.

    The information contained on the University of Virginia’s Department of Information Technology and Communication (ITC) website is provided as a public service with the understanding that ITC makes no representations or warranties, either expressed or implied, concerning the accuracy, completeness, reliability or suitability of the information, including warrantees of title, non-infringement of copyright or patent rights of others. These pages are expected to represent the University of Virginia community and the State of Virginia in a professional manner in accordance with the University of Virginia’s Computing Policies.