Creating a View of DRIECON Data Using the SQL Procedure

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

                   SAS Sample Library

        Name: famex05d.sas
 Description: Example program from SAS/ETS User's Guide,
              The SASEFAME Interface Engine
   Title: Creating a View of DRIECON Data Using the SQL Procedure
 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 driecon.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)
                         range='01jan1980'd - '01jan2006'd;
----------------------------------------------------------------*/

title2 'DRIECON: Dual Embedded Library Allocations with FAME Option';
options validvarname=any;

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

proc sql;
   create view fameview as
      select date, husts
      from lib1.driecon
      using libname lib1 sasefame "%sysget(FAME_DATA)"
                         convert=(tech=constant freq=annual)
                         range='01jan1980'd - '01jan2006'd ,
            libname temp "%sysget(FAME_TEMP)";
quit;

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