GLOBAL INSIGHT:DRI Data Delivery Service Database


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

                    SAS Sample Library

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

   Title: GLOBAL INSIGHT:DRI Data Delivery Service Database
 Product: SAS/ETS Software
  System: ALL
    Keys: DATASOURCE  data extraction from various sources
   Procs: DATASOURCE
    Data: sasmisc: drifxrat.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 drifxrat.dat file.
          To assign a fileref to the external file to be processed,
          use the following form of the filename statement:

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

options validvarname=any;
filename datafile "%sysget(DATASRC_DATA)drifxrat.dat" RECFM=F LRECL=80;
proc format;
   value distekfm 0 = 'Unspecified'
                  2 = 'Linear'
                  4 = 'Triag'
                  6 = 'Polynomial'
                  8 = 'Even'
                 10 = 'Step'
                 12 = 'Stocklast'
                 14 = 'LinearUnadjusted'
                 16 = 'PolyUnadjusted'
                 18 = 'StockWithNAS'
                 99 = 'None'
                255 = 'None';

   value convtkfm 0 = 'Unspecified'
                  1 = 'Average'
                  3 = 'AverageX'
                  5 = 'Sum'
                  7 = 'SumAnn'
                  9 = 'StockEnd'
                 11 = 'StockBegin'
                 13 = 'AvgNP'
                 15 = 'MaxNP'
                 17 = 'MinNP'
                 19 = 'StockEndNP'
                 21 = 'StockBeginNP'
                 23 = 'Max'
                 25 = 'Min'
                 27 = 'AvgXNP'
                 29 = 'SumNP'
                 31 = 'SumAnnNP'
                 99 = 'None'
                255 = 'None';

 /*--------------------------------------------------------*
  *                 process daily series                   *
  *--------------------------------------------------------*/
title3 'Reading DAILY Federal Reserve Series with fxrates_.dds';
proc datasource filetype=dridds
                infile=datafile
                interval=day
                out=fixr
                outcont=fixrcnt
                outall=fixrall;
   keep rx: ;
   range from '01jan97'd to '31dec99'd;
   format disttek distekfm.;
   format convtek convtkfm.;
run;

title1 'CONTENTS of FXRATES_.DDS File, KEEP RX:';
proc print
   data=fixrcnt;
run;

title1 'Daily Series Available in FXRATES_.DDS File, KEEP RX:';
proc print
   data=fixr;
run;