This example shows how to retrieve data for multiple time series that have different default frequencies. The time series are Domestic Financial Commercial Paper Outstanding (DFINCP), Domestic Nonfinancial Commercial Paper Outstanding (DNFINCP), Foreign Financial Commercial Paper Outstanding (FFINCP), Foreign Nonfinancial Commercial Paper Outstanding (FNFINCP), and Total Credit Market Assets Held by Domestic Financial Sectors (ABSITCMAHDFS). The native frequency of the first four time series is ‘Weekly’, and the native frequency of the last time series (ABSITCMAHDFS) is ‘Quarterly’. Note that the requested frequency as it is specified by the FREQ= option is ‘Weekly’ (FREQ=w). The native frequency of the last time series (ABSITCMAHDFS) is lower than the requested frequency. Therefore, this time series is excluded from the list, and only the observations that correspond to the first four time series are presented. If you want to retrieve the observations for all five time series, then the value of the FREQ= option needs to be less than or equal to all the native frequencies (here, weekly and quarterly). In this case, the valid frequency parameters would be ‘q’, ‘sa’, and ‘a’. See Example 39.4.
title 'Selecting Time Series When Native Frequency Is Less Than Requested Frequency'; libname _all_ clear; libname fred sasefred "%sysget(FRED)" OUTXML=fredex03 AUTOMAP=replace MAPREF=MyMap XMLMAP="%sysget(FRED)fredex03.map" APIKEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' IDLIST='dfincp,dnfincp,ffincp,fnfincp,absitcmahdfs' START='2010-01-01' END='2010-05-20' FREQ='w' OUTPUT=1 FORMAT=xml; data diffNative_freqw; set fred.fredex03 ; run;
proc contents data=diffNative_freqw; run; proc print data=diffNative_freqw; run;
Output 39.3.1: Selecting Time Series When Native Frequency Is Less Than Requested Frequency
Selecting Time Series When Native Frequency Is Less Than Requested Frequency |
Obs | date | realtime_start | realtime_end | DFINCP | DNFINCP | FFINCP | FNFINCP |
---|---|---|---|---|---|---|---|
1 | 2010-01-06 | 2014-03-17 | 2014-03-17 | 295.1 | 86.9 | 248.6 | 23.9 |
2 | 2010-01-13 | 2014-03-17 | 2014-03-17 | 315.0 | 90.1 | 241.6 | 25.8 |
3 | 2010-01-20 | 2014-03-17 | 2014-03-17 | 314.9 | 90.1 | 230.3 | 27.5 |
4 | 2010-01-27 | 2014-03-17 | 2014-03-17 | 370.0 | 83.0 | 232.7 | 31.3 |
5 | 2010-02-03 | 2014-03-17 | 2014-03-17 | 350.1 | 84.0 | 225.0 | 34.0 |
6 | 2010-02-10 | 2014-03-17 | 2014-03-17 | 363.9 | 81.3 | 223.7 | 36.2 |
7 | 2010-02-17 | 2014-03-17 | 2014-03-17 | 366.7 | 83.3 | 226.2 | 38.5 |
8 | 2010-02-24 | 2014-03-17 | 2014-03-17 | 385.8 | 77.1 | 231.8 | 39.0 |
9 | 2010-03-03 | 2014-03-17 | 2014-03-17 | 366.8 | 78.7 | 227.8 | 40.1 |
10 | 2010-03-10 | 2014-03-17 | 2014-03-17 | 380.1 | 79.2 | 229.3 | 40.1 |
11 | 2010-03-17 | 2014-03-17 | 2014-03-17 | 360.5 | 84.5 | 224.2 | 39.4 |
12 | 2010-03-24 | 2014-03-17 | 2014-03-17 | 355.1 | 82.7 | 218.5 | 39.8 |
13 | 2010-03-31 | 2014-03-17 | 2014-03-17 | 352.7 | 90.6 | 217.7 | 40.0 |
14 | 2010-04-07 | 2014-03-17 | 2014-03-17 | 335.2 | 95.8 | 217.6 | 40.0 |
15 | 2010-04-14 | 2014-03-17 | 2014-03-17 | 329.4 | 93.4 | 209.2 | 40.3 |
16 | 2010-04-21 | 2014-03-17 | 2014-03-17 | 326.8 | 93.1 | 211.8 | 41.6 |
17 | 2010-04-28 | 2014-03-17 | 2014-03-17 | 358.9 | 95.3 | 203.4 | 41.9 |
18 | 2010-05-05 | 2014-03-17 | 2014-03-17 | 353.8 | 91.3 | 200.8 | 43.4 |
19 | 2010-05-12 | 2014-03-17 | 2014-03-17 | 358.5 | 90.7 | 190.3 | 43.2 |
20 | 2010-05-19 | 2014-03-17 | 2014-03-17 | 330.0 | 92.4 | 180.5 | 40.9 |