I am attempting to use SASEFRED to access the FRED database. I have been going through the examples in the SAS documentation, and I'm having issues. I have my APIKEY from FRED. Below is my code that I modified from an example located at: http://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/etsug/etsug_sasefred_details11.htm . I am using SAS on Demand for Academics.
Here are my questions/comments:
options validvarname=any
/* sslcalistloc="/SASSecurityCertificateFramework/1.1/cacerts/trustedcerts.pem"; */
title 'FRED Data: SP500 Stock Index and Wilshire 5000 Price Index';
LIBNAME FRED sasefred "/home/u49890908/FRED"
OUTXML=gstart
AUTOMAP=replace
MAPREF=FRED
XMLMAP="/home/u49890908/FRED/gstart.map"
APIKEY='FAKEAPIKEY0123456789012346579801'
IDLIST='sp500,will5000pr'
START='2011-01-01'
END='2012-01-01'
FREQ='m'
FORMAT=xml;
data stock_price;
set FRED.gstart;
run;
proc contents data=stock_price;
run;
proc print data=stock_price;
run;
Here's my log.
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 options validvarname=any
74
75 /* sslcalistloc="/SASSecurityCertificateFramework/1.1/cacerts/trustedcerts.pem" */;
76 title 'FRED Data: SP500 Stock Index and Wilshire 5000 Price Index';
77 LIBNAME FRED sasefred "/home/u49890908/FRED"
78 OUTXML=gstart
79 AUTOMAP=replace
80 MAPREF=FRED
81 XMLMAP="/home/u49890908/FRED/gstart.map"
82 APIKEY='FAKEAPIKEY0123456789012346579801'
83 IDLIST='sp500,will5000pr'
84 START='2011-01-01'
85 END='2012-01-01'
86 FREQ='m'
87 FORMAT=xml;
NOTE: The default frequency of this timeseries (SP500) is equal or higher than the requested FREQ (m).
NOTE: Ran the FILENAME URL assignment to request FRED data.
NOTE: Ran the DATA Step to get the FRED data for the OUTXML= option.
NOTE: Ran the XMLV2 data engine with the XMLMAP= option.
NOTE: The default frequency of this timeseries ( WILL5000PR) is equal or higher than the requested FREQ (m).
NOTE: Ran the FILENAME URL assignment to request FRED data.
NOTE: Ran the DATA Step to get the FRED data for the OUTXML= option.
NOTE: Ran the XMLV2 data engine with the XMLMAP= option.
NOTE: Libref FRED was successfully assigned as follows:
Engine: SASEFRED
Physical Name: /home/u49890908/FRED
88
89 data stock_price;
90 set FRED.gstart;
NOTE: Ran the data step to access and save the FRED data.
ERROR: Database /home/u49890908/FRED/GSTART.sas7bdat could not be opened successfully. The file may not exist or it is currently
locked.
ERROR: Error detected by XOINFO routine: discrepancy in nvars or nobs count.
91 run;
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.STOCK_PRICE may be incomplete. When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.STOCK_PRICE was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
real time 0.23 seconds
user cpu time 0.12 seconds
system cpu time 0.01 seconds
memory 1638.46k
OS Memory 36276.00k
Timestamp 06/21/2023 07:06:49 PM
Step Count 167 Switch Count 48
Page Faults 0
Page Reclaims 1119
Page Swaps 0
Voluntary Context Switches 636
Involuntary Context Switches 0
Block Input Operations 1472
Block Output Operations 1688
92
93 proc contents data=stock_price;
94 run;
NOTE: PROCEDURE CONTENTS used (Total process time):
real time 0.03 seconds
user cpu time 0.04 seconds
system cpu time 0.00 seconds
memory 775.50k
OS Memory 35756.00k
Timestamp 06/21/2023 07:06:49 PM
Step Count 168 Switch Count 0
Page Faults 0
Page Reclaims 59
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 8
95
96 proc print data=stock_price;
97 run;
NOTE: No variables in data set WORK.STOCK_PRICE.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 364.37k
OS Memory 35496.00k
Timestamp 06/21/2023 07:06:49 PM
Step Count 169 Switch Count 0
Page Faults 0
Page Reclaims 16
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
98
99 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
111
Hi Paul,
I think you are referring to this engine in SAS/ETS:
SAS Help Center: Getting Started: SASEFRED Interface Engine
While SAS OnDemand for Academics does include access to the ETS procedures, it does not include access to this SASEFRED engine.
If interested, you could contact SAS technical support to find out other ways you can access this engine:
Hi Paul,
I think you are referring to this engine in SAS/ETS:
SAS Help Center: Getting Started: SASEFRED Interface Engine
While SAS OnDemand for Academics does include access to the ETS procedures, it does not include access to this SASEFRED engine.
If interested, you could contact SAS technical support to find out other ways you can access this engine:
I'll try using SASEFRED on the SAS 9.4 installed on my laptop.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Ready to level-up your skills? Choose your own adventure.