The SASEFAME Interface Engine |
Example 34.8 Selecting Time Series Using CROSSLIST= Option and KEEP Statement
This example shows how to use two FAME namelists to perform selection. Note that fame_namelist1 could be easily generated using the FAME WILDLIST function. For more about WILDLIST, refer to "The WILDLIST Function" in the FAME Command Reference Volume 2, Functions. In the following statements, 11 tickers are selected in fame_namelist1, but when you use the KEEP statement, the resulting data set contains only the desired IBM ticker shown in Output 34.8.1 and Output 34.8.2.
libname lib8 sasefame "%sysget(FAME_DATA)"
convert=(frequency=business technique=constant)
crosslist=(
{ IBM,SPALN,SUNW,XOM },
{ adjust, close, high, low, open, volume,
uclose, uhigh, ulow,uopen,uvolume }
);
data trout;
/* eleven companies, keep only the IBM ticker this time */
set lib8.training;
where date between '01mar02'd and '20mar02'd;
keep IBM: ;
run;
title2 'Contents of OUT=trout for BYGROUP Tick=IBM.';
proc contents
data=trout;
run;
title2 'TRAINING DB, Pricing Timeseries for IBM Ticker in CROSSLIST=';
title3 'OUT=TROUT from the PRINT Procedure';
proc print
data=trout;
run;
Output 34.8.1
Contents of the IBM Time Series in the Training FAME Data
IBM.ADJUST |
Num |
8 |
IBM.CLOSE |
Num |
8 |
IBM.HIGH |
Num |
8 |
IBM.LOW |
Num |
8 |
IBM.OPEN |
Num |
8 |
IBM.UCLOSE |
Num |
8 |
IBM.UHIGH |
Num |
8 |
IBM.ULOW |
Num |
8 |
IBM.UOPEN |
Num |
8 |
IBM.UVOLUME |
Num |
8 |
IBM.VOLUME |
Num |
8 |
Output 34.8.2
Listing of Ticker IBM Time Series in the Training FAME Data
1 |
103.020 |
103.100 |
98.500 |
98.600 |
103.020 |
103.100 |
98.500 |
98.600 |
104890 |
104890 |
1 |
105.900 |
106.540 |
103.130 |
103.350 |
105.900 |
106.540 |
103.130 |
103.350 |
107650 |
107650 |
1 |
105.670 |
106.500 |
104.160 |
104.250 |
105.670 |
106.500 |
104.160 |
104.250 |
75617 |
75617 |
1 |
106.300 |
107.090 |
104.750 |
105.150 |
106.300 |
107.090 |
104.750 |
105.150 |
76874 |
76874 |
1 |
103.710 |
107.500 |
103.240 |
107.300 |
103.710 |
107.500 |
103.240 |
107.300 |
109720 |
109720 |
1 |
105.090 |
107.340 |
104.820 |
104.820 |
105.090 |
107.340 |
104.820 |
104.820 |
107260 |
107260 |
1 |
105.240 |
105.970 |
103.600 |
104.350 |
105.240 |
105.970 |
103.600 |
104.350 |
86391 |
86391 |
1 |
108.500 |
108.850 |
105.510 |
105.520 |
108.500 |
108.850 |
105.510 |
105.520 |
110640 |
110640 |
1 |
107.180 |
108.650 |
106.700 |
108.300 |
107.180 |
108.650 |
106.700 |
108.300 |
64086 |
64086 |
1 |
106.600 |
107.950 |
106.590 |
107.020 |
106.600 |
107.950 |
106.590 |
107.020 |
53335 |
53335 |
1 |
106.790 |
107.450 |
105.590 |
106.550 |
106.790 |
107.450 |
105.590 |
106.550 |
108640 |
108640 |
1 |
106.350 |
108.640 |
106.230 |
107.100 |
106.350 |
108.640 |
106.230 |
107.100 |
53048 |
53048 |
1 |
107.490 |
108.050 |
106.490 |
106.850 |
107.490 |
108.050 |
106.490 |
106.850 |
46148 |
46148 |
1 |
105.500 |
106.900 |
105.490 |
106.900 |
105.500 |
106.900 |
105.490 |
106.900 |
48367 |
48367 |
|
|
Copyright
© 2008 by SAS Institute Inc., Cary, NC, USA. All
rights reserved.