Example 41.12 Selecting Variables Based on Short Source Key Code

Using the information from Example 41.11, you can now select time series by using selection keys such as the SHORT= , GEOG1=, or GEOG2= options. Since the short source values are nontrivial in database haverd, it is best in this case to use the SHORT= option. For more information about using geography codes as selection keys, see Output 41.13.1 for the GEOG1= option and Output 41.13.2 for the GEOG2= option.

Libname lib1 sasehavr "%sysget(HAVER_DATA)"
        short="GOLDMAN, FRB, CRB";
data validE2;
   set lib1.haverd;
   where date  between '18jan2005'd and '29mar2005'd;
run;

title1 'SHORT= option list: GOLDMAN, FRB, CRB';
title2 'Should contain these time series:';
title3 'FCM10, FCM1M, FFED, FFP1D';
title4 'SHORT= option, Print the OUT= ValidE2 Data Set';
proc print data=validE2; 
run;

title4 'SHORT= option, Print the Contents of OUT= ValidE2 Data Set';
proc contents data=validE2;
run;

Output 41.12.1 shows the output for the SHORT= option.

Output 41.12.1 SHORT= Option Shows the Selected Variables
SHORT= option list: GOLDMAN, FRB, CRB
Should contain these time series:
FCM10, FCM1M, FFED, FFP1D
SHORT= option, Print the Contents of OUT= ValidE2 Data Set

Obs DATE FCM10 FCM1M FFED FFP1D
1 18JAN2005 4.21 2.05 2.31 2.30
2 19JAN2005 4.20 1.95 2.19 2.22
3 20JAN2005 4.17 1.89 2.25 2.22
4 21JAN2005 4.16 2.02 2.26 2.19
5 24JAN2005 4.14 2.05 2.26 2.22
6 25JAN2005 4.20 2.13 2.29 2.22
7 26JAN2005 4.21 2.16 2.33 2.26
8 27JAN2005 4.22 2.16 2.39 2.30
9 28JAN2005 4.16 2.12 2.48 2.37
10 31JAN2005 4.14 2.06 2.50 2.47
11 01FEB2005 4.15 2.23 2.40 2.47
12 02FEB2005 4.15 2.22 2.29 2.45
13 03FEB2005 4.18 2.18 2.49 2.46
14 04FEB2005 4.09 2.20 2.51 2.45
15 07FEB2005 4.07 2.27 2.50 2.47
16 08FEB2005 4.05 2.34 2.48 2.45
17 09FEB2005 4.00 2.34 2.50 2.45
18 10FEB2005 4.07 2.35 2.51 2.47
19 11FEB2005 4.10 2.36 2.50 2.48
20 14FEB2005 4.08 2.37 2.51 2.50
21 15FEB2005 4.10 2.40 2.53 2.54
22 16FEB2005 4.16 2.39 2.48 2.45
23 17FEB2005 4.19 2.40 2.50 2.47
24 18FEB2005 4.27 2.39 2.51 2.45
25 21FEB2005 . . 2.51 .
26 22FEB2005 4.29 2.43 2.57 2.49
27 23FEB2005 4.27 2.47 2.53 2.48
28 24FEB2005 4.29 2.48 2.55 2.52
29 25FEB2005 4.27 2.50 2.54 2.52
30 28FEB2005 4.36 2.51 2.52 2.58
31 01MAR2005 4.38 2.55 2.39 2.51
32 02MAR2005 4.38 2.54 2.48 2.44
33 03MAR2005 4.39 2.55 2.51 2.49
34 04MAR2005 4.32 2.56 2.50 2.46
35 07MAR2005 4.31 2.59 2.51 2.49
36 08MAR2005 4.38 2.61 2.49 2.47
37 09MAR2005 4.52 2.60 2.50 2.45
38 10MAR2005 4.48 2.60 2.52 2.49
39 11MAR2005 4.56 2.60 2.51 2.48
40 14MAR2005 4.52 2.62 2.59 2.53
41 15MAR2005 4.54 2.70 2.61 2.60
42 16MAR2005 4.52 2.68 2.57 2.50
43 17MAR2005 4.47 2.68 2.68 2.58
44 18MAR2005 4.51 2.70 2.70 2.68
45 21MAR2005 4.53 2.72 2.71 2.72
46 22MAR2005 4.63 2.77 2.72 2.68
47 23MAR2005 4.61 2.72 2.73 2.69
48 24MAR2005 4.60 2.70 2.75 2.62
49 25MAR2005 . . 2.80 2.59
50 28MAR2005 4.64 2.69 2.79 2.79
51 29MAR2005 . . . 2.76

If you also want to see a list of all the variables and their corresponding labels for this data set, you can run the CONTENTS Procedure.

Output 41.12.2 shows the output.

Output 41.12.2 SHORT= Option Shows the Contents of the validE2 Data Set
Alphabetic List of Variables and Attributes
# Variable Type Len Format Label
1 DATE Num 8 DATE9. Date of Observation
2 FCM10 Num 8   10-Year Treasury Note Yield at Constant Maturity (Avg, % p.a.)
3 FCM1M Num 8   1-Month Treasury Bill Market Bid Yield at Constant Maturity (%)
4 FFED Num 8   Federal Funds [Effective] Rate (% p.a.)
5 FFP1D Num 8   1-Day AA Financial Commercial Paper (% per annum)