Previous Page | Next Page

The SASEFAME Interface Engine

The LIBNAME libref SASEFAME Statement

LIBNAME libref SASEFAME ’physical nameoptions ;

Since physical name specifies the location of the folder where your FAME database resides, it should end in a backslash if you are in a Windows environment, or a forward slash if you are in a UNIX environment.

If you are accessing a remote FAME database by using FAME CHLI, you can use the following syntax for physical name:’#port_number@hostname physical_path_name

The following options can be used in the LIBNAME libref SASEFAME statement.

CONVERT=( FREQ=fame_frequency TECH=fame_technique)

specifies the FAME frequency and the FAME technique just as you would in the FAME CONVERT function. There are four possible values for fame_technique: CONSTANT (default), CUBIC, DISCRETE, or LINEAR. All FAME frequencies except PPY and YPP are supported by the SASEFAME engine.

For a more complete discussion of FAME frequencies and SAS time intervals, see the section Mapping FAME Frequencies to SAS Time Intervals. For all possible fame_frequency values, refer to "Understanding Frequencies" in the User’s Guide to FAME. For example:

   LIBNAME libref sasefame 'physical-name'
           CONVERT=(TECH=CONSTANT FREQ=TWICEMONTHLY);


WILDCARD="fame_wildcard"

By default, the SASEFAME engine reads all time series in the FAME database that you name in your SASEFAME libref. You can limit the time series read from the FAME database by specifying the WILDCARD= option in your LIBNAME statement. The fame_wildcard is a quoted string containing the FAME wildcard you want to use. The wildcard is used for matching against the data object names of series you want to select from the FAME database that resides in the library you are assigning.

For more information about wildcarding, see "Specifying Wildcards" in the User’s Guide to FAME.

For example, to read all time series in the TEST library being accessed by the SASEFAME engine, you would specify

   LIBNAME test sasefame 'physical name of test database'
           WILDCARD="?";

To read series with names such as A_DATA, B_DATA, or C_DATA, you could specify

   LIBNAME test sasefame 'physical name of test database'
           WILDCARD="^_DATA";

When you use the WILDCARD= option, you are limiting the number of series that are read and converted to the desired frequency. This option can help you save resources when processing large databases or when processing a large number of observations, such as daily or hourly frequencies. Since the SASEFAME engine uses the FAME WORK database to store the converted time series, using wildcards is recommended to prevent your WORK space from getting too large. When the FAMEOUT= option is also specified, the wildcard is applied to the type of data object series you specify in the FAMEOUT= option.

RANGE=’fame_begdt’d-’fame_enddt’d

To limit the time range of data read from your FAME database, specify the RANGE= option in your SASEFAME libref, where fame_begdt is the beginning date in ddmonyyyy format and fame_enddt is the ending date of the range in ddmonyyyy format.

As an example, to read a series with a date range that spans the first quarter of 1999, you could use the following statement:

   LIBNAME test sasefame 'physical name of test database'
           RANGE='01jan1999'd - '31mar1999'd;
INSET=(setname WHERE=fame_bygroup )

When you specify a SAS data set named setname as input for a BY group such as tickers, the SASEFAME engine uses the fame_bygroup to select time series that are named using the following convention. Selected variable names are glued together by the ticker name concatenated with the glue character (such as DOT) to the series name that is specified in the CROSSLIST= option or the fame_namelist. See the following example that uses both the CROSSLIST= option and the INSET= option with the WHERE= clause.


CROSSLIST=( [ fame_namelist1 ] , fame_namelist2 )

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.

Using the CROSSLIST= option with the optional fame_namelist1 causes the SASEFAME engine to perform a crossproduct of the first namelist’s members with the second namelist’s members, using a glue symbol "." to join the two.

For example, if your FAME database has a namelist named TICKER defined by

   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

   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})
           ;

then the 132 variables shown in Table 34.2 are selected by the CROSSLIST= option.

Table 34.2 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 from your INSET= option to perform the crossproduct of the BY variables specified in your INSET via the WHERE= clause, with the members named in your namelist. Suppose you have defined a SAS input dataset named INSETA and you want to use it as input for your 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 with a WHERE clause or you use a FAME namelist for your CROSSLIST= selection, the two methods are equivalent ways of performing the same selection function. In the preceding example, the FAME ticker namelist corresponds to the SAS INSET’s BY variable named TICK.

Note that the WHERE= fame_bygroup must match your BY variable name used in your INSET= in order for the CROSSLIST= option to perform the desired selection. If one of the time series listed in your fame_namelist2 does not exist, the SASEFAME engine stops processing the remainder of the namelist. For complete results you should 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 INSET= option and used in your WHERE= clause.

FAMEOUT=fame_data_object_class_type

specifies the class and type of the FAME data series objects you want in your SAS output data set. The possible values for fame_data_object_class_type are FORMULA, TIME, BOOLEAN, CASE, DATE, and STRING. If the FAMEOUT= option is not specified, numeric time series are output to the SAS data set. FAMEOUT=CASE defaults to case series of numeric type, so if you want another type of case series in your output, then you must specify it. Scalar data objects are not supported.

Previous Page | Next Page | Top of Page