Resources

Selecting Time Series Variables - The KEEP and DROP Statements


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

                    SAS Sample Library

       Name: datgs01.sas
Description: Example program from SAS/ETS User's Guide,
             The DATASOURCE Procedure

   Title: Selecting Time Series Variables - The KEEP and DROP Statements
 Product: SAS/ETS Software
  System: ALL
    Keys: DATASOURCE  data extraction from various sources
   Procs: DATASOURCE
    Data: sasmisc: citiaf.dat (DATASOURCE database files)
   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, DATASRC_DATA, to the path of your
          writeable folder containing
          the citiaf.dat file.
          To assign a fileref to the external file to be processed,
          use the following form of the filename statement:

filename citifile "%sysget(DATASRC_DATA)citiaf.dat" RECFM=F LRECL=80;
--------------------------------------------------------------*/

/*-- Selecting Time Series Variables -- The KEEP and DROP Statements --*/
filename citifile "%sysget(DATASRC_DATA)citiaf.dat" RECFM=F LRECL=80;
proc datasource filetype=dribasic infile=citifile
                interval=month  outcont=vars;
   drop e: ;
run;

title1 'Some Time Series Variables Available in CITIFILE';
proc print data=vars;
run;