SASEFRED Interface Engine

Example 48.8 Vintage Dates for a Specific Series with the URL= Option

(View the complete code for this example.)

The following statements demonstrate how to use the URL= option to obtain the VINTAGE_DATE and VINTAGE_DATES data sets for a specified series and how to create a permanent data set named VINDAT1 in the MyLib SAS library.[15]You must specify the series in both the URL= option and the IDLIST= option.


options validvarname=any;

title 'Specifying the URL= Option to Create the VINTAGE_DATES Data Set';
libname _all_ clear;
libname mylib "< path to your folder for data >";
libname fred1 sasefred "%sysget(FRED)"
   URL="https://api.stlouisfed.org/fred/series/vintagedates?series_id=N5005C1A027NBEA"
   APIKEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
   IDLIST= 'N5005C1A027NBEA'
   ;

data mylib.vindat1;
   set fred1.XFREDtpu;
run;
proc print
   data=mylib.vindat1;
run;

proc contents
   data=mylib.vindat1;
run;

The list of available vintage dates for the N5005C1A027NBEA series is read from the XFREDtpu.xml file that is downloaded by the SASEFRED engine. The contents are shown in Output 48.8.1. The engine automatically maps the data in the XML file and reads the data into the XFREDTPU data set when the SET statement is executed. When the DATA step runs, the data in the temporary utility data set are read and stored in the permanent data set named vindat1.sas7bdat in the MyLib library. A side effect of the DATA step is the automatic creation of two SAS data sets, named vintage_date.sas7bdat and vintage_dates.sas7bdat, in the FRED1 library’s location.

Output 48.8.1: Specifying the URL= Option to Create the VINTAGE_DATES Data Set

Specifying the URL= Option to Create the VINTAGE_DATES Data Set

Obs vintage_dates_ORDINAL vintage_date_ORDINAL vintage_date
1 1 1 2013-02-28
2 1 2 2013-03-28
3 1 3 2013-05-30
4 1 4 2013-07-31
5 1 5 2014-03-27
6 1 6 2014-05-29
7 1 7 2014-07-30
8 1 8 2015-03-27
9 1 9 2015-05-29
10 1 10 2015-07-30
11 1 11 2016-03-25
12 1 12 2016-05-27
13 1 13 2016-07-29
14 1 14 2017-03-30
15 1 15 2017-05-26
16 1 16 2017-07-28
17 1 17 2017-10-27
18 1 18 2018-03-28
19 1 19 2018-05-30
20 1 20 2018-07-27
21 1 21 2019-03-28
22 1 22 2019-05-30
23 1 23 2019-07-26
24 1 24 2020-03-26




[15] Disclaimer: SAS may reference other websites or content or resources for use at Customer's sole discretion. SAS has no control over any websites or resources that are provided by companies or persons other than SAS. Customer acknowledges and agrees that SAS is not responsible for the availability or use of any such external sites or resources, and does not endorse any advertising, products, or other materials on or available from such websites or resources. Customer acknowledges and agrees that SAS is not liable for any loss or damage that may be incurred by Customer or its end users as a result of the availability or use of those external sites or resources, or as a result of any reliance placed by Customer or its end users on the completeness, accuracy, or existence of any advertising, products, or other materials on, or available from, such websites or resources.

Last updated: June 19, 2025