The SASEHAVR Interface Engine

Example 42.1 Examining the Contents of a Haver Database

To see which time series are in your Haver database, use the CONTENTS procedure with the SASEHAVR LIBNAME statement to read the contents.

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;

All time series in the Haver haverw database are listed alphabetically in Output 42.1.1.

Output 42.1.1: Examining the Contents of Haver Analytics Database, haverw.dat

Haver Analytics Database, HAVERW.DAT
PROC CONTENTS for Time Series converted to yearly frequency

The CONTENTS Procedure

Alphabetic List of Variables and Attributes
# Variable Type Len Format Label
1 DATE Num 8 YEAR4. Date of Observation
2 FA Num 8   Total Assets: All Commercial Banks (SA, Bil.$)
3 FCM1M Num 8   1-Month Treasury Bill Market Bid Yield at Constant Maturity (%)
4 FM1 Num 8   Money Stock: M1 (SA, Bil.$)
5 FTA1MA Num 8   Treasury 4-Week Bill: Total Amount Accepted (Bil$)
6 FTB3 Num 8   3-Month Treasury Bills, Auction (% p.a.)
7 LICN Num 8   Unemployment Insurance: Initial Claims, State Programs (NSA, Thous)


You could also use the following SAS statements to create a SAS data set named hwouty and to print its contents.

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;

The preceding LIBNAME LIB1 statement specifies that all time series in the haverw database be converted to a yearly frequency but to select only the range of data from January 1, 1992, to December 31, 2004. The resulting SAS data set hwouty is shown in Output 42.1.2.

Output 42.1.2: Defining a Range inside the Data Range for Yearly Time Series

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

Obs DATE FA FCM1M FM1 FTA1MA FTB3 LICN
1 1992 3466.3 . 965.31 . 3.45415 407.340
2 1993 3624.6 . 1077.69 . 3.01654 344.934
3 1994 3875.8 . 1144.85 . 4.28673 340.054
4 1995 4209.3 . 1142.70 . 5.51058 357.038
5 1996 4399.1 . 1106.46 . 5.02096 351.358
6 1997 4820.3 . 1069.23 . 5.06885 321.513
7 1998 5254.8 . 1079.56 . 4.80726 317.077
8 1999 5608.1 . 1101.14 . 4.66154 301.581
9 2000 6115.4 . 1104.07 . 5.84644 301.108
10 2001 6436.2 2.31368 1136.31 11.753 3.44471 402.583
11 2002 7024.9 1.63115 1192.03 18.798 1.61548 402.796
12 2003 7302.9 1.02346 1268.40 16.089 1.01413 399.137
13 2004 7950.5 1.26642 1337.89 13.019 1.37557 345.109