The SASEFAME Interface Engine

LIBNAME libref SASEFAME Statement

  • LIBNAME libref SASEFAME 'physical name' options;

Because '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 the Fame CHLI, you can use the following syntax for 'physical name':'#port_number @hostname physical_path_name '

You can specify the following options.

CONVERT=( FREQ=fame_frequency TECH=fame_technique)
CONV=( 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, and Linear. Table 47.4 shows the Fame frequencies that 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, see the section "Understanding Frequencies" in the User’s Guide to Fame. For example:

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

limits the time series read from the Fame database. By default, the SASEFAME engine reads all time series in the Fame database that you name in your SASEFAME libref. The fame_wildcard is a quoted string that contains the Fame wildcard you want to use. The wildcard is used for matching against the data object names of series that you want to select from the Fame database that resides in the library you are assigning.

For more information about using wildcards, see the section "Specifying Wildcards" in the User’s Guide to Fame.

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

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

To read series that have names such as A_DATA, B_DATA, and C_DATA, you could specify the following statement:

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

When you use the WILDCARD= option, you limit 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. Because the SASEFAME engine uses the Fame Work database to store the converted time series, using wildcards is recommended to prevent your workspace from getting too large. When the FAMEOUT= option is also specified, the wildcard is applied to the type of data object series that you specify in the FAMEOUT= option.

RANGE=’fame_begdt’d-’fame_enddt’d
DATERANGE=’fame_begdt’d-’fame_enddt’d
DATE=’fame_begdt’d-’fame_enddt’d
DATECASE=’fame_begdt’d-’fame_enddt’d

limits the time range of data that are read from your Fame database. The string fame_begdt is the beginning date in ddmmmyyyy format, and the string fame_enddt is the ending date of the range in ddmmmyyyy format; both strings must be enclosed in single quotation marks and followed by the letter d.

For 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 KEEP=fame_expression_group )
INSET=(setname KEEPLIST=fame_expression_group )

specifies the name of a SAS data set (setname) and selects series that are generated by the expressions defined in fame_expression_group. You can define fame_expression_group by using Fame functions and Fame expressions. It is important to specify the length of the longest expression, or expressions might be truncated because the default length is the first defined variable in the DATA step. The INSET (input data set) must output each expression statement as a character string ending with a semicolon, enclosed in single quotation marks, and followed by another semicolon and an output statement. Note: The EXPRESS variable is assigned the character string expression, and is shown in Table 47.2. The following statements create an input data set, INSETA, and print it:

data inseta; /* Use this for training database */
  length express $52;
  express='{ibm.high,ibm.low,ibm.close};'; output;
  express='crosslist({gm,f,c},{volume});'; output;
  express='cvx.close;'; output; 
  express='mave(ibm.close,30);'; output; 
  express='cvx.close+ibm.close;'; output;
  express='ibm.close;'; output;
  express='close * shares/sum(close * shares);'; output;
  express='sum(pep.volume);'; output;
  express='mave(pep.close,20);'; output;
run;

proc print
   data=inseta;
run;

Next you can name the input data set that you want to use in the INSET= option, followed by the KEEP= variable that specifies the expression group you want to keep. Only series variables that are defined in the selected expression group are output to the output data set. You can define up to eight different expression groups in an INSET= option.

  libname lib5 sasefame "C:\PROGRA~1\FAME10\util"
     wildcard="?"
     convert=(frequency=business technique=constant) 
     range='23jul1997'd - '25jul1997'd
     inset=( inseta KEEP=express) 
     ;
 
data trout;
   set lib5.trainten;
run;

title1 'TRAINING DB, Pricing Timeseries for Expressions in INSET=';
title2 'OUT=TROUT from the PRINT Procedure';
proc print data=trout;
run;

Table 47.2 shows the eight expressions that are defined in INSETA.

Table 47.2: SAS Input Data Set, INSETA, Defined for Use in the INSET= Option

Observation

EXPRESS

1

cvx.close;

2

ibm.high,ibm.low,ibm.close;

3

mave(ibm.close,30);

4

crosslist(gm,f,c,volume);

5

cvx.close+ibm.close;

6

ibm.close;

7

sum(pep.volume);

8

mave(pep.close,20);


Table 47.3 shows the output data set, TROUT. The output data set names each derived variable 'SASTEMPn' by appending the number, n, to match the observation number of the input data set’s expression for that variable. For example, SASTEMP1 names the series derived by 'cvx.close' in observation 1, and SASTEMP3 names the series derived by the expression 'mave(ibm.close,30);' in observation 3. Because SASTEMP2 is a simple name list of three series, the original series names are used.

Table 47.3: TRAINING DB, Pricing Timeseries for Expressions in INSETA for OUT=TROUT from the PRINT Procedure

DATE

C.VOLUME

VOLUME

GM.VOLUME

IBM.CLOSE

IBM.HIGH

23JUL1997

33791.88

45864.05

37392

52.5625

53.5000

24JUL1997

41828.85

29651.34

27771

53.9063

54.2188

25JUL1997

46979.83

36716.77

24969

53.5000

54.2188

IBM.LOW

SASTEMP1

SASTEMP3

SASTEMP5

SASTEMP6

SASTEMP8

51.5938

38.4063

.

90.9688

52.5625

.

52.2500

38.4375

.

92.3438

53.9063

.

52.8125

39.0000

.

92.5000

53.5000

.


Note that SASTEMP3 and SASTEMP8 have no observations in the date range July 23, 1997, to July 25, 1997, so the missing value symbol '.' appears for those observations.

INSET=(setname WHERE=fame_bygroup )

specifies a SAS data set (setname) as input for a BY group such as a ticker, and uses the fame_bygroup to select time series that are named using the following convention. Selected variable names are glued together by the BY-group name (such as a ticker symbol) concatenated with the glue character (such as DOT) to the series name that is specified in the CROSSLIST= option or in the fame_bygroup.

For more information, see the section Performing the Crosslist Selection Function.

CROSSLIST=( < fame_namelist1, > fame_namelist2 )
CROSS=( < fame_namelist1, > fame_namelist2 )

performs a crossproduct of the members of the first namelist with the members of the second namelist, using a glue symbol "." to join the two. If one of the time series that are listed in fame_namelist2 does not exist, the SASEFAME engine stops processing the remainder of the namelist. For more information, see the section Performing the Crosslist Selection Function.

FAMEOUT=fame_data_object_class_type

specifies the class and type of the Fame data series objects to include in your SAS output data set. The possible values for fame_data_object_class_type are FORMULA, TIME, BOOLEAN, CASE, DATE, and STRING. Case series can be numeric, boolean, string, and date, or they can be generated using formulas that resolve to series. The SASEFAME engine resolves all formulas that belong to the type of series data object that you specify in the FAMEOUT= option. 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. If you want another type of case series in your output, then you must specify it. Scalar data objects are not supported.

DBVERSION=ON | OFF

specifies whether to display the version number of the Fame Work database. DBVERSION=ON specifies that the SAS log show the version number (3 or 4) of the Fame Work database. By default, DBVERSION=OFF.

TUNEFAME=NODES fameengine_size_virtual_memory_MB

specifies the number of megabytes to use for the cache size for the Fame API (CHLI). The fameengine_size_virtual_memory_MB can range from a minimum of 0.1 MB (100 KB) to a maximum of 17,592,186,000,000 MB. For more information, see Example 47.17.

TUNECHLI=NODES famechliengine_size_virtual_memory_MB

specifies the number of megabytes to use for the cache size for the Fame API (CHLI). The famechliengine_size_virtual_memory_MB can range from a minimum of 0.1 MB (100 KB) to a maximum of 17,592,186,000,000 MB. For more information, see Example 47.17.