The SASEHAVR Interface Engine |
Example 35.8 Using the KEEP Option to Subset Time Series from a HAVER Database
To select specific time series, the KEEP= or DROP= option can also be used as follows.
libname lib1 sasehavr "%sysget(HAVER_DATA)"
freq=daily
start=20041101
end=20041231
keep="FCM*";
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=20041231 LIBNAME options.';
title4 ' Subset further: Using keep="FCM*" LIBNAME option ';
proc print data=hwoutd;
run;
Output 35.8.1 shows two series that are selected by using KEEP="FCM*" on the LIBNAME statement.
Output 35.8.1
Using the KEEP Option along with Defining a Range Using START=20041101 END=20041231
01NOV2004 |
4.11 |
1.79 |
02NOV2004 |
4.10 |
1.86 |
03NOV2004 |
4.09 |
1.83 |
04NOV2004 |
4.10 |
1.85 |
05NOV2004 |
4.21 |
1.86 |
08NOV2004 |
4.22 |
1.88 |
09NOV2004 |
4.22 |
1.89 |
10NOV2004 |
4.25 |
1.88 |
11NOV2004 |
. |
. |
12NOV2004 |
4.20 |
1.91 |
15NOV2004 |
4.20 |
1.92 |
16NOV2004 |
4.21 |
1.93 |
17NOV2004 |
4.14 |
1.90 |
18NOV2004 |
4.12 |
1.91 |
19NOV2004 |
4.20 |
1.98 |
22NOV2004 |
4.18 |
1.98 |
23NOV2004 |
4.19 |
1.99 |
24NOV2004 |
4.20 |
1.98 |
25NOV2004 |
. |
. |
26NOV2004 |
4.24 |
2.01 |
29NOV2004 |
4.34 |
2.02 |
30NOV2004 |
4.36 |
2.07 |
01DEC2004 |
4.38 |
2.06 |
02DEC2004 |
4.40 |
2.06 |
03DEC2004 |
4.27 |
2.06 |
06DEC2004 |
4.24 |
2.09 |
07DEC2004 |
4.23 |
2.08 |
08DEC2004 |
4.14 |
2.08 |
09DEC2004 |
4.19 |
2.07 |
10DEC2004 |
4.16 |
2.07 |
13DEC2004 |
4.16 |
2.04 |
14DEC2004 |
4.14 |
2.01 |
15DEC2004 |
4.09 |
1.98 |
16DEC2004 |
4.19 |
1.93 |
17DEC2004 |
4.21 |
1.95 |
20DEC2004 |
4.21 |
1.97 |
21DEC2004 |
4.18 |
1.92 |
22DEC2004 |
4.21 |
1.84 |
23DEC2004 |
4.23 |
1.83 |
24DEC2004 |
. |
. |
27DEC2004 |
4.30 |
1.90 |
28DEC2004 |
4.31 |
1.88 |
29DEC2004 |
4.33 |
1.76 |
30DEC2004 |
4.27 |
1.68 |
31DEC2004 |
4.24 |
1.89 |
The DROP option can be used to drop specific variables from a HAVER database. To specify this option, use DROP= instead of KEEP=.