The SASEHAVR Interface Engine |
Example 35.9 Using the SOURCE Option to Subset Time Series from a HAVER Database
To select specific variables that belong to a certain source, the SOURCE= or DROPSOURCE= option can be used, similar to the way you use the KEEP= or DROP= option.
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;
Output 35.9.1 shows two series that are selected by using SOURCE="FRB" on the LIBNAME statement.
Output 35.9.1
Using the SOURCE Option along with Defining a Range Using START=20041101 END=20041213
01NOV2004 |
4.11 |
1.83 |
1.80 |
0.7460 |
02NOV2004 |
4.10 |
1.74 |
1.74 |
0.7447 |
03NOV2004 |
4.09 |
1.73 |
1.73 |
0.7539 |
04NOV2004 |
4.10 |
1.77 |
1.75 |
0.7585 |
05NOV2004 |
4.21 |
1.76 |
1.75 |
0.7620 |
08NOV2004 |
4.22 |
1.80 |
1.84 |
0.7578 |
09NOV2004 |
4.22 |
1.79 |
1.81 |
0.7618 |
10NOV2004 |
4.25 |
1.92 |
1.85 |
0.7592 |
11NOV2004 |
. |
1.92 |
. |
. |
12NOV2004 |
4.20 |
2.02 |
1.96 |
0.7685 |
15NOV2004 |
4.20 |
2.06 |
2.03 |
0.7719 |
16NOV2004 |
4.21 |
1.98 |
1.95 |
0.7728 |
17NOV2004 |
4.14 |
1.99 |
1.93 |
0.7833 |
18NOV2004 |
4.12 |
1.99 |
1.94 |
0.7786 |
19NOV2004 |
4.20 |
1.99 |
1.93 |
0.7852 |
22NOV2004 |
4.18 |
2.01 |
1.96 |
0.7839 |
23NOV2004 |
4.19 |
2.00 |
1.95 |
0.7860 |
24NOV2004 |
4.20 |
2.02 |
1.89 |
0.7863 |
25NOV2004 |
. |
2.02 |
. |
. |
26NOV2004 |
4.24 |
2.01 |
1.97 |
0.7903 |
29NOV2004 |
4.34 |
2.03 |
2.00 |
0.7852 |
30NOV2004 |
4.36 |
2.02 |
2.04 |
0.7723 |
01DEC2004 |
4.38 |
2.04 |
2.01 |
0.7754 |
02DEC2004 |
4.40 |
2.00 |
1.98 |
0.7769 |
03DEC2004 |
4.27 |
1.98 |
1.96 |
0.7778 |
06DEC2004 |
4.24 |
2.04 |
1.98 |
0.7748 |
07DEC2004 |
4.23 |
1.99 |
1.99 |
0.7754 |
08DEC2004 |
4.14 |
2.01 |
1.98 |
0.7545 |
09DEC2004 |
4.19 |
2.05 |
2.03 |
0.7532 |
10DEC2004 |
4.16 |
2.09 |
2.07 |
0.7495 |
13DEC2004 |
4.16 |
2.18 |
2.13 |
0.7592 |
14DEC2004 |
4.14 |
2.24 |
2.22 |
0.7566 |
15DEC2004 |
4.09 |
2.31 |
2.27 |
0.7652 |
16DEC2004 |
4.19 |
2.26 |
2.24 |
0.7563 |
17DEC2004 |
4.21 |
2.23 |
2.20 |
0.7607 |
20DEC2004 |
4.21 |
2.26 |
2.21 |
0.7644 |
21DEC2004 |
4.18 |
2.24 |
2.21 |
0.7660 |
22DEC2004 |
4.21 |
2.25 |
2.22 |
0.7656 |
23DEC2004 |
4.23 |
2.34 |
2.08 |
0.7654 |