Example 11.5 DRI Data Delivery Service Database
This example demonstrates the DRIDDS filetype for the daily Federal Reserve Series fxrates_dds. Use VALIDVARNAME=ANY in your SAS options statement to allow special characters such as @, $, and % to be in the series name. Note the use of long variable names in the OUT= data set in Output 11.5.2 and long labels in the OUTCONT= data set in Output 11.5.1.
The following statements extract daily series starting in January 1,1997:
options validvarname=any;
filename datafile "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;
Output 11.5.1
Listing of the OUTCONT=FIXRCNT Data Set for FILETYPE=DRIDDS
RXA$%US$@AU |
1 |
1 |
1 |
5 |
2 |
EXCHANGE RATE IN AUSTRALIAN DOLLAR PER US DOLLAR - AUSTRALIA |
|
0 |
0 |
@FACS/DATA.D |
Unspecified |
Unspecified |
0 |
31JAN97 |
132605 |
RXBF%US$@BE |
1 |
1 |
1 |
5 |
3 |
EXCHANGE RATE IN BELGIAN FRANCS PER US DOLLAR - BELGIUM |
|
0 |
0 |
@FACS/DATA.D |
Unspecified |
Unspecified |
0 |
31JAN97 |
132544 |
RXDK%US$@DK |
1 |
1 |
1 |
5 |
4 |
EXCHANGE RATE IN DANISH KRONE PER 100 US DOLLAR - DENMARK |
|
0 |
0 |
@FACS/DATA.D |
Unspecified |
Unspecified |
0 |
31JAN97 |
132544 |
Output 11.5.2
Printout of the OUT=FIXR Data Set for FILETYPE=DRIDDS
01JAN1997 |
1.26133 |
31.9200 |
5.92877 |
02JAN1997 |
1.26133 |
31.9200 |
5.92877 |
03JAN1997 |
1.26133 |
31.9200 |
5.92877 |
04JAN1997 |
1.27708 |
32.4620 |
6.01098 |
05JAN1997 |
1.27708 |
32.4620 |
6.01098 |
06JAN1997 |
1.27708 |
32.4620 |
6.01098 |
07JAN1997 |
1.27708 |
32.4620 |
6.01098 |
08JAN1997 |
1.27708 |
32.4620 |
6.01098 |
09JAN1997 |
1.27708 |
32.4620 |
6.01098 |
10JAN1997 |
1.27708 |
32.4620 |
6.01098 |
11JAN1997 |
1.28443 |
32.9360 |
6.09112 |
12JAN1997 |
1.28443 |
32.9360 |
6.09112 |
13JAN1997 |
1.28443 |
32.9360 |
6.09112 |
14JAN1997 |
1.28443 |
32.9360 |
6.09112 |
15JAN1997 |
1.28443 |
32.9360 |
6.09112 |
16JAN1997 |
1.28443 |
32.9360 |
6.09112 |
17JAN1997 |
1.28443 |
32.9360 |
6.09112 |
18JAN1997 |
1.29195 |
33.7500 |
6.24658 |
19JAN1997 |
1.29195 |
33.7500 |
6.24658 |
20JAN1997 |
1.29195 |
33.7500 |
6.24658 |
21JAN1997 |
1.29195 |
33.7500 |
6.24658 |
22JAN1997 |
1.29195 |
33.7500 |
6.24658 |
23JAN1997 |
1.29195 |
33.7500 |
6.24658 |
24JAN1997 |
1.29195 |
33.7500 |
6.24658 |
25JAN1997 |
1.30133 |
33.8974 |
6.27520 |
26JAN1997 |
1.30133 |
33.8974 |
6.27520 |
27JAN1997 |
1.30133 |
33.8974 |
6.27520 |
28JAN1997 |
1.30133 |
33.8974 |
6.27520 |
29JAN1997 |
1.30133 |
33.8974 |
6.27520 |
30JAN1997 |
1.30133 |
33.8974 |
6.27520 |
31JAN1997 |
1.30133 |
33.8974 |
6.27520 |