The SASEFAME Interface Engine

Example 41.10 Selecting Time Series by Using the CROSSLIST= Option and WHERE=TICK

Instead of having a Fame namelist with the ticker symbols for companies whose data you are interested in, you can designate an input SAS data set (INSETA) that specifies the tickers to select. Specify your selection by using the WHERE clause in the INSET= option as follows:

data inseta;
   length tick $5;
   /* need $5 so SPALN is not truncated */

   tick='AOL';   output;
   tick='C';     output;
   tick='CPQ';   output;
   tick='CVX';   output;
   tick='F';     output;
   tick='GM';    output;
   tick='HWP';   output;
   tick='IBM';   output;
   tick='SPALN'; output;
   tick='SUNW';  output;
   tick='XOM';   output;
run;

libname lib10 sasefame "%sysget(FAME_DATA)"
        convert=(frequency=business technique=constant)
        range='07jul1997'd - '25jul1997'd
        inset=( inseta where=tick )
        crosslist=
            ( {adjust, close, high, low, open, volume,
               uclose, uhigh, ulow,uopen,uvolume} );

data trout;
   /* eleven companies with unique TICKs specified in INSETA */
   set lib10.training;
   keep IBM: ;
run;

title1 'TRAINING DB, Pricing Timeseries for Eleven Tickers in CROSSLIST=';
title2 'Using INSET with WHERE=TICK.';
proc print data=trout;
run;

proc contents data=trout;
run;

Output 41.10.1 and Output 41.10.2 show the results.

Output 41.10.1: Listing of OUT=TROUT Using CROSSLIST= and INSET= Options in the Fame TRAINING Data

TRAINING DB, Pricing Timeseries for Eleven Tickers in CROSSLIST=
Using INSET with WHERE=TICK.

Obs IBM.ADJUST IBM.CLOSE IBM.HIGH IBM.LOW IBM.OPEN IBM.UCLOSE IBM.UHIGH IBM.ULOW IBM.UOPEN IBM.UVOLUME IBM.VOLUME
1 0.5 47.2500 47.7500 47.0000 47.5000 94.500 95.500 94.000 95.000 129012 64506
2 0.5 47.8750 47.8750 47.2500 47.2500 95.750 95.750 94.500 94.500 102796 51398
3 0.5 48.0938 48.3438 47.6563 48.0000 96.188 96.688 95.313 96.000 177276 88638
4 0.5 47.8750 48.0938 47.0313 47.3438 95.750 96.188 94.063 94.688 127900 63950
5 0.5 47.8750 48.6875 47.8125 47.9063 95.750 97.375 95.625 95.813 137724 68862
6 0.5 47.6250 48.2188 47.0000 47.8125 95.250 96.438 94.000 95.625 128976 64488
7 0.5 48.0000 48.1250 46.6875 47.4375 96.000 96.250 93.375 94.875 149612 74806
8 0.5 48.8125 49.0000 47.6875 47.8750 97.625 98.000 95.375 95.750 215440 107720
9 0.5 49.8125 50.8750 48.5625 48.9063 99.625 101.750 97.125 97.813 315504 157752
10 0.5 52.2500 52.6250 50.0000 50.0000 104.500 105.250 100.000 100.000 463480 231740
11 0.5 51.8750 53.1563 51.0938 52.6250 103.750 106.313 102.188 105.250 328184 164092
12 0.5 51.5000 51.7500 49.6875 50.0313 103.000 103.500 99.375 100.063 368276 184138
13 0.5 52.5625 53.5000 51.5938 52.1875 105.125 107.000 103.188 104.375 219880 109940
14 0.5 53.9063 54.2188 52.2500 52.8125 107.813 108.438 104.500 105.625 204088 102044
15 0.5 53.5000 54.2188 52.8125 53.9688 107.000 108.438 105.625 107.938 146600 73300



Output 41.10.2: Contents of OUT=TROUT Using CROSSLIST= and INSET= Options in the Fame TRAINING Data

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