Renaming Time Series Variables


                    SAS Sample Library

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

   Title: Renaming Time Series Variables
 Product: SAS/ETS Software
  System: ALL
    Keys: DATASOURCE  data extraction from various sources
    Data: sasmisc: imfifs1.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 imfifs1.dat file.
          To assign a fileref to the external file to be processed,
          use the following form of the filename statement:

filename ifsfile "%sysget(DATASRC_DATA)imfifs1.dat" RECFM=F LRECL=88;

filename ifsfile "%sysget(DATASRC_DATA)imfifs1.dat" RECFM=F LRECL=88;

proc datasource filetype=imfifsp infile=ifsfile
                out=market outcont=mrktvars;
   where country in ('112','146','158') and partner=' ';
   keep  f___aa f___ac;
   range from '01jun85'd to '01feb86'd;
   rename  f___aa=alphmkt  f___ac=charmkt;
   label   f___aa='F___AA: Market Rate Conversion Factor Used in Alpha Test'
           f___ac='F___AC: Market Rate Conversion Used in Charlie Test';

title1 'Printout of OUTCONT= Showing New NAMEs and LABELs';
proc print data=mrktvars ;
   var  name label length;

title1 'Contents of OUT= Showing New NAMEs and LABELs';
proc contents data=market;