Resources

Examining the Contents of a Haver Database

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

                    SAS Sample Library

        Name: havex01.sas
 Description: Example program from SAS/ETS User's Guide,
              The SASEHAVR Interface Engine
    Title: Examining the Contents of a Haver Database
  Product: SAS/ETS Software
     Keys: SASEHAVR
    Procs:
    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, HAVER_DATA, to the path of your
           writeable folder containing
           the haverw.dat and haverw.idx files (Haver database files).
           To assign a fileref to the external file to be processed,
           use the following form of the libname statement:

libname lib1 sasehavr "%sysget(HAVER_DATA)"
        freq=yearly start=19920101
        end=20041231
        force=freq;
----------------------------------------------------------------*/

libname lib1 sasehavr "%sysget(HAVER_DATA)"
        freq=yearly start=19920101
        end=20041231
        force=freq;

data hwouty;
   set lib1.haverw;
run;

title1 'Haver Analytics Database, HAVERW.DAT';
title2 'PROC CONTENTS for Time Series converted to yearly frequency';
proc contents data=hwouty;
run;

libname lib1 sasehavr "%sysget(HAVER_DATA)"
       freq=yearly
       start=19920101
       end=20041231
       force=freq;

data hwouty;
   set lib1.haverw;
run;

title1 'Haver Analytics Database, Frequency=yearly, infile=haverw.dat';
title2 'Define a range inside the data range for OUT= dataset,';
title3 'Using the START=19920101 END=20041231 LIBNAME options.';

proc print data=hwouty;
run;