BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mcs
Obsidian | Level 7 mcs
Obsidian | Level 7

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
1 ACCEPTED SOLUTION

Accepted Solutions
Bari_sas
SAS Employee

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.

View solution in original post

2 REPLIES 2
Bari_sas
SAS Employee

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.

mcs
Obsidian | Level 7 mcs
Obsidian | Level 7

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