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

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

                   SAS Sample Library

        Name: famex05c.sas
 Description: Example program from SAS/ETS User's Guide,
              The SASEFAME Interface Engine
   Title: Creating a View of DB77 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 db77.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);
----------------------------------------------------------------*/

title2 'DB77: 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, ann, 'qandom.x'n
      from lib1.db77
      using libname lib1 sasefame "%sysget(FAME_DATA)"
                    convert=(tech=constant freq=annual),
            libname temp "%sysget(FAME_TEMP)";
 quit;

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