The SASEFAME Interface Engine

Example 41.1 Converting an Entire Fame Database

To enable conversion of all time series no wildcard is specified, so the default ? wildcard is used. Always consider both the number of time series and the number of observations generated by the conversion process. The converted series reside in the Fame Work database during the SAS DATA step. You can further limit your resulting SAS data set by using KEEP, DROP, or WHERE statements inside your DATA step.

The following statements convert a Fame database and print out its contents:

options pagesize=60 linesize=80 validvarname=any ;
%let FAME=%sysget(FAME);
%put(&FAME);
%let FAMETEMP=%sysget(FAME_TEMP);
%put(&FAMETEMP);

libname famedir sasefame "%sysget(FAME_DATA)"
        convert=(freq=annual technique=constant);
 
libname mydir "%sysget(FAME_TEMP)";

data mydir.a;  /* add data set to mydir */
   set famedir.oecd1;
   /* Read in oecd1.db data from the Organization */
   /*  For Economic Cooperation and Development    */
   where date between '01jan88'd and '31dec93'd;
run;

proc print data=mydir.a;
run;

In the preceding example, the Fame database is called oecd1.db and it resides in the famedir directory. The DATA statement names the SAS output data set 'a', that will reside in mydir. All time series in the Fame oecd1.db database will be converted to an annual frequency and reside in the mydir.a SAS data set. Since the time series variable names contain the special glue symbol '.', the SAS option statement specifies VALIDVARNAME=ANY. See the SAS System Options: Reference for more information about this option. The Fame environment variable is the location of the Fame installation. On Windows, the log would look like this:

1             options validvarname=any;

2             %let FAME=%sysget(FAME);
3             %put(&FAME);
(C:\PROGRA~1\FAME)
4             %let FAMETEMP=%sysget(FAME_TEMP);
5             %put(&FAMETEMP);
(\\ge\U11\saskff\fametemp\)
6
7             libname famedir sasefame "&FAME\util"
8                     convert=(freq=annual technique=constant);
NOTE: Libref FAMEDIR was successfully assigned as follows:
      Engine:        FAMECHLI
      Physical Name: C:\PROGRA~1\FAME\util
9
10            libname mydir '\\dntsrc\usrtmp\saskff';
NOTE: Libref MYDIR was successfully assigned as follows:
      Engine:        V9
      Physical Name: \\dntsrc\usrtmp\saskff
11
12            data mydir.a;  /* add data set to mydir */
13               set famedir.oecd1;
AUS.DIRDES -- SERIES (NUMERIC by ANNUAL)
AUS.DIRDES copied to work data base as AUS.DIRDES.

For more about the glue DOT character, refer to Gluing Names Together in the User’s Guide to Fame. In the preceding log, the variable name AUS.DIRDES uses the glue DOT between AUS and DIRDES.

The PROC PRINT statement creates Output 41.1.1 which shows all of the observations in the mydir.a SAS data set.

Output 41.1.1: Listing of OUT=MYDIR.A of the OECD1 Fame Data

Obs DATE AUS.DIRDES AUS.HERD AUT.DIRDES AUT.HERD BEL.DIRDES BEL.HERD CAN.DIRDES CAN.HERD CHE.DIRDES CHE.HERD DEU.DIRDES DEU.HERD DNK.DIRDES DNK.HERD ESP.DIRDES ESP.HERD FIN.DIRDES FIN.HERD FRA.DIRDES FRA.HERD GBR.DIRDES GBR.HERD GRC.DIRDES GRC.HERD IRL.DIRDES IRL.HERD ISL.DIRDES ISL.HERD ITA.DIRDES ITA.HERD JPN.DIRDES JPN.HERD NLD.DIRDES NLD.HERD NOR.DIRDES NOR.HERD NZL.DIRDES NZL.HERD PRT.DIRDES PRT.HERD SWE.DIRDES SWE.HERD TUR.DIRDES TUR.HERD USA.DIRDES USA.HERD YUG.DIRDES YUG.HERD
1 1988 750 1072.90 . . 374 16572.70 1589.60 2006 632.100 1532 3538.60 8780.00 258.100 2662 508.200 55365.5 247.700 1602.0 2573.50 19272.00 2627.00 1592.00 60.600 6674.50 49.6000 37.0730 . . 1861.50 2699927 9657.20 2014073 883 2105 . . . . 111.5 10158.20 . . 174.400 74474 20246.20 20246.20 233.000 29.81
2 1989 . . . . . 18310.70 1737.00 2214 . 1648 3777.20 9226.60 284.800 2951 623.600 69270.5 259.700 1725.5 2856.50 21347.80 2844.10 1774.20 119.800 14485.20 50.2000 39.0130 10.3000 786.762 1968.00 2923504 10405.90 2129372 945 2202 308.900 2771.40 78.7000 143.800 . . 1076 11104 212.300 143951 22159.50 22159.50 205.100 375.22
3 1990 . . . . . 18874.20 1859.20 2347 . . 2953.30 9700.00 . . 723.600 78848.0 271.000 1839.0 3005.20 22240.00 . . . . 51.7000 . 11.0000 902.498 2075.00 3183071 . 2296992 . . . . . . . . . . . . 23556.10 23556.10 . 2588.50
4 1991 . . . . . . 1959.60 2488 . . . . . . . 89908.0 . . . . . . . . . . 11.8000 990.865 2137.80 3374000 . . . . 352.000 3100.00 . . . . . . . . 24953.80 24953.80 . .