SASEFRED Interface Engine

Example 48.14 Sources for Today’s Date with the URL= Option

(View the complete code for this example.)

The following statements demonstrate how to use the URL= option to obtain the first 10 sources (LIMIT=10) for the SOURCES6 data set for today’s date and how to create a permanent data set named SOURCES6 in the MyLib SAS library:[21]


options validvarname=any;

title 'Specifying the URL= Option to Create the SOURCES6 Data Set';
libname _all_ clear;
libname mylib "< path to your folder for data >";

libname fred6 sasefred "%sysget(FRED)"
   debug=on
   URL="https://api.stlouisfed.org/fred/sources?limit=10"
   APIKEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
   ;

data mylib.sources6;
   set fred6.XFREDtpu;
run;
proc print
   data=mylib.sources6;
run;

proc contents
   data=mylib.sources6;
run;

The returned data are stored in the XFREDTPU data set and are copied to the permanent data set named sources6.sas7bdat in the MyLib library. A side effect of the DATA step is the automatic creation of two SAS data sets, named source.sas7bdat and sources.sas7bdat, in the FRED6 library’s location. Many sources could be returned for today’s date, but the LIMIT=10 option obtains only the first 10 sources, as shown in Output 48.14.1.

Output 48.14.1: Specifying the URL= Option to Create the SOURCES6 Data Set

Specifying the URL= Option to Create the SOURCES6 Data Set

Obssources_ORDINALsource_ORDINALsource_idsource_realtime_startsource_realtime_endsource_namesource_link
11112020-05-122020-05-12Board of Governors of the Federal Reserve System (US)http://www.federalreserve.gov/
21232020-05-122020-05-12Federal Reserve Bank of Philadelphiahttps://www.philadelphiafed.org/
31342020-05-122020-05-12Federal Reserve Bank of St. Louishttp://www.stlouisfed.org/
41462020-05-122020-05-12Federal Financial Institutions Examination Council (US)http://www.ffiec.gov/
515112020-05-122020-05-12Dow Jones & Companyhttp://www.dowjones.com
616142020-05-122020-05-12University of Michiganhttps://www.umich.edu/
717152020-05-122020-05-12Council of Economic Advisers (US)https://www.whitehouse.gov/cea/
818162020-05-122020-05-12U.S. Office of Management and Budgethttps://www.whitehouse.gov/omb/
919172020-05-122020-05-12U.S. Congressional Budget Officehttp://www.cbo.gov/
10110182020-05-122020-05-12U.S. Bureau of Economic Analysishttp://www.bea.gov/




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