Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
The DATASOURCE Procedure

Example 10.5: DRI Data Delivery Service Database

This example demonstrates the DRIDDS filetype for the daily Federal Reserve Series fxrates_dds. Use VALIDVARNAME=ANY on your SAS options statement to allow special characters such as @, $, and % to be allowed in the series name. Note the use of long variable names in the OUT= data set and long labels in the OUTCONT= data set.

The following statements extract the daily series starting from January 1,1997:

   filename datafile 'host-specific-file-name' <host-options>;
   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;
   
      range from '01jan97'd to '31dec99'd;
      format disttek distekfm.;
      format convtek convtkfm.;
   run;

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.