Resources

Creating a View of OECD Data Using the SQL Procedure and SASEFAME

/*----------------------------------------------------------------

                   SAS Sample Library

        Name: famex05a.sas
 Description: Example program from SAS/ETS User's Guide,
              The SASEFAME Interface Engine
   Title: Creating a View of OECD Data Using the SQL Procedure and SASEFAME
 Product: SAS/ETS Software
    Keys: FAME data extraction, View FAME data
   Procs: SASEFAME, SQL
   Notes: Read this before you run this sample.
        The database resides in the ets/sasmisc folder. You
        must copy the database to a writeable folder before
        using it. Then define your Windows system environment
        variable, FAME_DATA, to the path of your
        writeable folder containing
        the oecd1.db file (FAME database).
        To assign a fileref to the external file to be processed,
        use the following form of the libname statement:

libname lib1 sasefame "%sysget(FAME_DATA)"
        convert=(tech=constant freq=annual);
----------------------------------------------------------------*/
 title1 'famesql5: PROC SQL Dual Embedded Libraries w/ FAME option';
 options validvarname=any;

 %let FAME=%sysget(FAME);
 %put(&FAME);
 %let FAMETEMP=%sysget(FAME_TEMP);
 %put(&FAMETEMP);

 title2 'OECD1: Dual Embedded Library Allocations with FAME Option';
 proc sql;
    create view fameview as
       select date, 'fin.herd'n
          from lib1.oecd1
       using libname lib1 sasefame "%sysget(FAME_DATA)"
                convert=(tech=constant freq=annual),
             libname temp "%sysget(FAME_TEMP)";
 quit;

 title2 'OECD1: Print of View from Embedded Library with FAME Option';
 proc print data=fameview;
 run;