The SASEFAME Interface Engine

Example 41.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, see the section The WILDLIST Function in the Fame Command Reference Volume 2, Functions. In the following statements, four tickers are selected in fame_namelist1, but when you use the KEEP statement, the resulting data set contains only the desired IBM ticker.

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;

title1 'TRAINING DB, Pricing Timeseries for IBM Ticker in CROSSLIST=';
proc contents
   data=trout;
run;
 
proc print
   data=trout;
run;

Output 41.8.1 and Output 41.8.2 show the results.

Output 41.8.1: Contents of the IBM Time Series in the Training Fame Data

TRAINING DB, Pricing Timeseries for IBM Ticker in CROSSLIST=

The CONTENTS Procedure

Alphabetic List of Variables and Attributes
# Variable Type Len
1 IBM.ADJUST Num 8
2 IBM.CLOSE Num 8
3 IBM.HIGH Num 8
4 IBM.LOW Num 8
5 IBM.OPEN Num 8
6 IBM.UCLOSE Num 8
7 IBM.UHIGH Num 8
8 IBM.ULOW Num 8
9 IBM.UOPEN Num 8
10 IBM.UVOLUME Num 8
11 IBM.VOLUME Num 8


Output 41.8.2: Listing of Ticker IBM Time Series in the Training Fame Data

TRAINING DB, Pricing Timeseries for IBM Ticker in CROSSLIST=

Obs IBM.ADJUST IBM.CLOSE IBM.HIGH IBM.LOW IBM.OPEN IBM.UCLOSE IBM.UHIGH IBM.ULOW IBM.UOPEN IBM.UVOLUME IBM.VOLUME
1 1 103.020 103.100 98.500 98.600 103.020 103.100 98.500 98.600 104890 104890
2 1 105.900 106.540 103.130 103.350 105.900 106.540 103.130 103.350 107650 107650
3 1 105.670 106.500 104.160 104.250 105.670 106.500 104.160 104.250 75617 75617
4 1 106.300 107.090 104.750 105.150 106.300 107.090 104.750 105.150 76874 76874
5 1 103.710 107.500 103.240 107.300 103.710 107.500 103.240 107.300 109720 109720
6 1 105.090 107.340 104.820 104.820 105.090 107.340 104.820 104.820 107260 107260
7 1 105.240 105.970 103.600 104.350 105.240 105.970 103.600 104.350 86391 86391
8 1 108.500 108.850 105.510 105.520 108.500 108.850 105.510 105.520 110640 110640
9 1 107.180 108.650 106.700 108.300 107.180 108.650 106.700 108.300 64086 64086
10 1 106.600 107.950 106.590 107.020 106.600 107.950 106.590 107.020 53335 53335
11 1 106.790 107.450 105.590 106.550 106.790 107.450 105.590 106.550 108640 108640
12 1 106.350 108.640 106.230 107.100 106.350 108.640 106.230 107.100 53048 53048
13 1 107.490 108.050 106.490 106.850 107.490 108.050 106.490 106.850 46148 46148
14 1 105.500 106.900 105.490 106.900 105.500 106.900 105.490 106.900 48367 48367