I'd like to use SASEFRED. I got an API key from FRED (masked in the code below), but I can't seem to connect. Is there a way to troubleshoot what's going wrong?
options validvarname=any;
%let PATH=C:\Users\svnd\Desktop;
libname fred sasefred "&PATH"
OUTXML=T10Y
XMLMAP="&PATH\T10Y.map"
APIKEY='XXXXXXXXXXXXXXXXXXXX'
IDLIST='DGS10';
run;
NOTE: Parsing with high validation.
ERROR: XMLMap parser encountered fatal XML error
Exception class: org.xml.sax.SAXParseException
ID: <null>
Message: Premature end of file.
Line: -1
Column: -1
ERROR: Unable to parse the specified file: file:/C:/Users/svnd/XFREDtp1.xml
Exception class: org.xml.sax.SAXParseException
WARNING: The default frequency of this timeseries (DGS10) is lower than the requested FREQ ().
WARNING: This timeseries (DGS10) is excluded because its default frequency is lower than the
requested FREQ ().
NOTE: Libref FRED was successfully assigned as follows:
Engine: SASEFRED
Physical Name: C:\Users\svnd\Desktop
Based on those messages I can't tell exactly what's failing, but there's a debug= option you can place on the LIBNAME statement to get more information in the SAS log. When you add debug=on you should see a filename statement generated in the log window. Can you use the url found in the log on your browser? If you get an error there, that implies a problem with the API key (too short, expired, etc.).
If the url works from the browser, and the debug= information does not help you determine root cause for the failure, then the debug= info is helpful for SAS Technical Support (me), along with the results of this code:
%put _automatic_;
Feel free to post back the results of the above tests or email them to support@sas.com to create a tracking entry with Tech Support so that I or someone on my team can do more research and offer you feedback.
Based on those messages I can't tell exactly what's failing, but there's a debug= option you can place on the LIBNAME statement to get more information in the SAS log. When you add debug=on you should see a filename statement generated in the log window. Can you use the url found in the log on your browser? If you get an error there, that implies a problem with the API key (too short, expired, etc.).
If the url works from the browser, and the debug= information does not help you determine root cause for the failure, then the debug= info is helpful for SAS Technical Support (me), along with the results of this code:
%put _automatic_;
Feel free to post back the results of the above tests or email them to support@sas.com to create a tracking entry with Tech Support so that I or someone on my team can do more research and offer you feedback.
Yes, when I use debug=on, the log shows a filename that includes my apikey, and I'm able to browse to that url successfully. It just shows a brief XML document including some series information.
I'll email you the debug info.
Martin
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.
Find more tutorials on the SAS Users YouTube channel.