Resources

The RANGE= Option - Limiting the Time Range of Data

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

                   SAS Sample Library

        Name: famex04a.sas
 Description: Example program from SAS/ETS User's Guide,
              The SASEFAME Interface Engine
   Title: The RANGE= Option - 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)
        range='01jan1988'd - '31dec1990'd;
----------------------------------------------------------------*/
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)
        range='01jan1988'd - '31dec1990'd;

libname mydir "%sysget(FAME_TEMP)";

data mydir.a;  /* add data set to mydir */
   set famedir.oecd1;
   /* range on the libref restricts the dates *
    * read from famedir's oecd1 database      */
run;

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