Resources

Using the SOURCE Option to Subset Time Series from Haver Data

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

                    SAS Sample Library

        Name: havex09.sas
 Description: Example program from SAS/ETS User's Guide,
              The SASEHAVR Interface Engine
    Title: Using the SOURCE Option to Subset Time Series from Haver Data
  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 haverd.dat and haverd.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=daily
        start=20041101
        end=20041223
        source="FRB";
----------------------------------------------------------------*/

libname lib1 sasehavr "%sysget(HAVER_DATA)"
        freq=daily
        start=20041101
        end=20041223
        source="FRB";

data hwoutd;
   set lib1.haverd;
run;

title1 'Haver Analytics Database, Frequency=daily, infile=haverd.dat';
title2 '   Define a range inside the data range for OUT= dataset';
title3 '   Using the START=20041101 END=20041223 LIBNAME options.';
title4 '   Subset further: Using source="FRB" LIBNAME option';
proc print data=hwoutd;
run;