Resources

WHERE Statement - Limiting the Time Range of Data

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

                   SAS Sample Library

        Name: famex04b.sas
 Description: Example program from SAS/ETS User's Guide,
              The SASEFAME Interface Engine
   Title: WHERE Statement - Limiting the Time Range of Data
 Product: SAS/ETS Software
    Keys: FAME data extraction
   Procs: SASEFAME
   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 famedir sasefame "%sysget(FAME_DATA)"
        convert=(freq=annual technique=constant);
----------------------------------------------------------------*/

options 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;
   /* where only  */
   where date between '01jan88'd and '31dec90'd;
run;

title1 "OECD1: TECH=Constant, FREQ=Annual";
proc print data=mydir.a;
run;