(View the complete code for this example.)
The following statements demonstrate how to use the URL= option to obtain the RELEASE and RELEASES data sets for a specific source and how to create a permanent data set named REL8 in the MyLib SAS library:[19]
options validvarname=any;
title 'Specifying the URL= Option to Create the REL8 Data Set';
libname _all_ clear;
libname mylib "< path to your folder for data >";
libname fred8 sasefred "%sysget(FRED)"
debug=on
URL="https://api.stlouisfed.org/fred/source/releases?source_id=11"
APIKEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
;
data mylib.rel8;
set fred8.XFREDtpu;
run;
proc print
data=mylib.rel8;
run;
proc contents
data=mylib.rel8;
run;
Output 48.12.1: Specifying the URL= Option to Create the REL8 Data Set
| Specifying the URL= Option to Create the REL8 Data Set |
| Obs | releases_ORDINAL | release_ORDINAL | release_id | release_realtime_start | release_realtime_end | release_name | release_press_release | release_link |
|---|---|---|---|---|---|---|---|---|
| 1 | 1 | 1 | 72 | 2020-05-12 | 2020-05-12 | Daily Treasury Inflation-Indexed Securities | false | |
| 2 | 1 | 2 | 102 | 2020-05-12 | 2020-05-12 | Wall Street Journal | true | http://online.wsj.com/public/us |
[19] 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.