Performing the Crosslist Selection Function

There are two methods for performing the crosslist selection function. The first method uses two Fame namelists, and the second method uses one namelist and one BY group specified in the WHERE= clause of the INSET= option.

For example, suppose that your Fame database has a string case series named TICKER, so that when the Fame NL function is used on TICKER, it returns the namelist

   Ticker = {AOL, C, CVX, F, GM, HPQ, IBM, INDUA, INTC, SPX, SUNW, XOM}

and your time series are named in fame_namelist2 as

{adjust, close, high, low, open, volume, uclose, uhigh, ulow, uopen, uvolume}

When you specify the following statements, then the 132 variables shown in Table 40.5 are selected by the CROSSLIST= option.

   LIBNAME test sasefame 'physical name of test database'
           RANGE='01jan1999'd - '31mar1999'd
           CROSSLIST=(nl(ticker),
                        {adjust, close, high, low, open, volume,
                         uclose, uhigh, ulow, uopen, uvolume})
           ;
Table 40.5 SAS Variables Selected by CROSSLIST= Option

AOL.ADJUST

C.ADJUST

CVX.ADJUST

F.ADJUST

AOL.CLOSE

C.CLOSE

CVX.CLOSE

F.CLOSE

AOL.HIGH

C.HIGH

CVX.HIGH

F.HIGH

AOL.LOW

C.LOW

CVX.LOW

F.LOW

AOL.OPEN

C.OPEN

CVX.OPEN

F.OPEN

AOL.UCLOSE

C.UCLOSE

CVX.UCLOSE

F.UCLOSE

AOL.UHIGH

C.UHIGH

CVX.UHIGH

F.UHIGH

AOL.ULOW

C.ULOW

CVX.ULOW

F.ULOW

AOL.UOPEN

C.UOPEN

CVX.UOPEN

F.UOPEN

AOL.UVOLUME

C.UVOLUME

CVX.UVOLUME

F.UVOLUME

AOL.VOLUME

C.VOLUME

CVX.VOLUME

F.VOLUME

GM.ADJUST

HPQ.ADJUST

IBM.ADJUST

INDUA.ADJUST

GM.CLOSE

HPQ.CLOSE

IBM.CLOSE

INDUA.CLOSE

GM.HIGH

HPQ.HIGH

IBM.HIGH

INDUA.HIGH

GM.LOW

HPQ.LOW

IBM.LOW

INDUA.LOW

GM.OPEN

HPQ.OPEN

IBM.OPEN

INDUA.OPEN

GM.UCLOSE

HPQ.UCLOSE

IBM.UCLOSE

INDUA.UCLOSE

GM.UHIGH

HPQ.UHIGH

IBM.UHIGH

INDUA.UHIGH

GM.ULOW

HPQ.ULOW

IBM.ULOW

INDUA.ULOW

GM.UOPEN

HPQ.UOPEN

IBM.UOPEN

INDUA.UOPEN

GM.UVOLUME

HPQ.UVOLUME

IBM.UVOLUME

INDUA.UVOLUME

GM.VOLUME

HPQ.VOLUME

IBM.VOLUME

INDUA.VOLUME

INTC.ADJUST

SPX.ADJUST

SUNW.ADJUST

XOM.ADJUST

INTC.CLOSE

SPX.CLOSE

SUNW.CLOSE

XOM.CLOSE

INTC.HIGH

SPX.HIGH

SUNW.HIGH

XOM.HIGH

INTC.LOW

SPX.LOW

SUNW.LOW

XOM.LOW

INTC.OPEN

SPX.OPEN

SUNW.OPEN

XOM.OPEN

INTC.UCLOSE

SPX.UCLOSE

SUNW.UCLOSE

XOM.UCLOSE

INTC.UHIGH

SPX.UHIGH

SUNW.UHIGH

XOM.UHIGH

INTC.ULOW

SPX.ULOW

SUNW.ULOW

XOM.ULOW

INTC.UOPEN

SPX.UOPEN

SUNW.UOPEN

XOM.UOPEN

INTC.UVOLUME

SPX.UVOLUME

SUNW.UVOLUME

XOM.UVOLUME

INTC.VOLUME

SPX.VOLUME

SUNW.VOLUME

XOM.VOLUME

Instead of using two namelists, you can use the WHERE= clause in an INSET= option to perform the crossproduct of the BY variables specified in your input data set via the WHERE= clause, with the members named in your namelist. The following statements define a SAS input data set named INSETA to use as input for the CROSSLIST= option instead of using the Fame namelist:

   DATA INSETA;
      LENGTH tick $5;
   /* AOL, C, CVX, F, GM, HPQ, IBM, INDUA, INTC, SPX, SUNW, XOM */
      tick='AOL'; output;
      tick='C'; output;
      tick='CVX'; output;
      tick='F'; output;
      tick='GM'; output;
      tick='HPQ'; output;
      tick='IBM'; output;
      tick='INDUA'; output;
      tick='INTC'; output;
      tick='SPX'; output;
      tick='SUNW'; output;
      tick='XOM'; output;
   RUN;

   LIBNAME test sasefame 'physical name of test database'
           RANGE='01jan1999'd - '31mar1999'd
           INSET=(inseta, where=tick)
           CROSSLIST=(
                 {adjust, close, high, low, open, volume,
                  uclose, uhigh, ulow, uopen, uvolume})
           ;

Whether you use a SAS INSET statement with a WHERE clause or you use a Fame namelist in the CROSSLIST= statement, the two methods are equivalent ways of performing the same selection function. In the preceding example, the Fame ticker namelist corresponds to the SAS input data set’s BY variable named TICK.

Note that the WHERE=fame_bygroup must match the BY variable name used in your input data set in order for the CROSSLIST= option to perform the desired selection. If one of the time series listed in fame_namelist2 does not exist, the SASEFAME engine stops processing the remainder of the namelist. For complete results, make sure that your fame_namelist2 is accurate and does not name unknown variables. The same holds true for fame_namelist1 and the BY variable values named in your input data set and used in your WHERE= clause.