SASEFRED Interface Engine

Example 48.10 Series for Specific Tags with the URL= Option

(View the complete code for this example.)

The following statements demonstrate how to use the URL= option to obtain the SERIES and SERIESS data sets for specified tag names and how to create a permanent data set named TAGS_SERIES4 in the MyLib SAS library:[17]


options validvarname=any;

title 'Specifying the URL= Option to Create the TAGS_SERIES4 Data Set.';
libname _all_ clear;
libname mylib "< path to your folder for data >";
libname fred4 sasefred "%sysget(FRED)" 
   debug=on
   URL="https://api.stlouisfed.org/fred/tags/series?tag_names=slovenia;food;oecd"
   APIKEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
   ;

data mylib.tags_series4;
   set fred4.XFREDtpu;
run;

proc print
   data=mylib.tags_series4(obs=2);
run;

proc contents
   data=mylib.tags_series4;
run;

The returned data are stored in the XFREDTPU data set and are copied to the permanent data set named tags_series4.sas7bdat in the MyLib library. A side effect of the DATA step is the automatic creation of two SAS data sets, named series.sas7bdat and seriess.sas7bdat, in the FRED4 library’s location. Many series are returned for the specified tag names; the OBS=2 option in the DATA statement in the PROC PRINT step prints only two of them. Output 48.10.1 shows the first two observations of the TAGS_SERIES4 data set.

Output 48.10.1: Specifying the URL= Option to Create the TAGS_SERIES4 Data Set

Specifying the URL= Option to Create the TAGS_SERIES4 Data Set.

Obs seriess_ORDINAL series_ORDINAL series_id series_realtime_start series_realtime_end series_title series_observation_start series_observation_end series_frequency series_frequency_short series_units series_units_short series_seasonal_adjustment series_seasonal_adjustment_short series_last_updated series_popularity series_group_popularity series_notes
1 1 1 CPGDFD02SIA657N 2020-05-12 2020-05-12 Consumer Price Index: Total Food Excluding Restaurants for Slovenia 1996-01-01 2017-01-01 Annual A Growth Rate Previous Period Growth Rate Previous Period Not Seasonally Adjusted NSA 2018-03-09 15:10:44-06 1 1 OECD descriptor ID: CPGDFD02 OECD unit ID: GP OECD country ID: SVN All OECD data should be cited as follows: OECD, "Main Economic Indicators - complete database", Main Economic Indicators (database),http://dx.doi.org/10.1787/data-00052-en (Accessed on date) Copyright, 2016, OECD. Reprinted with permission.
2 1 2 CPGDFD02SIA659N 2020-05-12 2020-05-12 Consumer Price Index: Total Food Excluding Restaurants for Slovenia 1996-01-01 2017-01-01 Annual A Growth Rate Same Period Previous Year Growth Rate Same Period Previous Yr. Not Seasonally Adjusted NSA 2018-03-09 15:22:46-06 1 1 OECD descriptor ID: CPGDFD02 OECD unit ID: GY OECD country ID: SVN All OECD data should be cited as follows: OECD, "Main Economic Indicators - complete database", Main Economic Indicators (database),http://dx.doi.org/10.1787/data-00052-en (Accessed on date) Copyright, 2016, OECD. Reprinted with permission.




[17] 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