Resources

Annual COMPUSTAT Data Files, Filetype CSAUCY3


/*--------------------------------------------------------------

                    SAS Sample Library

        Name: datex08.sas
 Description: Example program from SAS/ETS User's Guide,
              The DATASOURCE Procedure

   Title: Annual COMPUSTAT Data Files, Filetype CSAUCY3
 Product: SAS/ETS Software
  System: ALL
    Keys: DATASOURCE  data extraction from various sources
   Procs: DATASOURCE
    Data: sasmisc: csaucy3.dat (DATASOURCE database files)
   Notes: Read this before you run this sample.
          The database resides in the ets/sasmisc folder. You
          must copy the database to a writeable folder before
          using it. Then define your Windows system environment
          variable, DATASRC_DATA, to the path of your
          writeable folder containing
          the csaucy3.dat file.
          To assign a fileref to the external file to be processed,
          use the following filename statement:

filename datafile "%sysget(DATASRC_DATA)csaucy3.dat" RECFM=F LRECL=13612;
--------------------------------------------------------------*/

filename datafile "%sysget(DATASRC_DATA)csaucy3.dat" RECFM=F LRECL=13612;
/*--------------------------------------------------------------*
 * create OUT=csauy3 data set with ASCII 2003 Industrial Data   *
 * compare it with the OUT=csauc data set created by DATA STEP  *
 *--------------------------------------------------------------*/

proc datasource filetype=csaucy3 ascii
                infile=datafile
                interval=year
                outselect=on
                outkey=y3key
                out=csauy3;

     keep data197-data199 label;
     range from 2002;
run;

proc sort
   data=csauy3 out=csauy3;
   by dnum cnum cic file zlist smbl xrel stk;
run;

title1 'Price, High, Low and Close for Range from 2002';
proc contents data=csauy3;
run;

proc print data=csauy3;
run;