Accessing Quandl data call from SAS using url method
I was trying accessing Quandl(http://www.quandl.com) data. Quandl is an
open website from where we can download readiliy available curated
time-series data on many financial and economic topics. They have build it
in such a manner that you can call it through R/Matlab/Eviews/Python etc.
I was trying from SAS. When I tried website Normal csv download call for
Quandl data "FRED/MSWP5" without any date condition it works fine and I am
able to create SAS dataset. code is as below:
filename DAAA url "http://www.quandl.com/api/v1/datasets/FRED/MSWP5.csv?";
data BY_AAA(drop=dd);
length dd $10;
format date date9.;
infile DAAA dlm="," dsd;
input dd$ value;
date=input(dd,yymmdd10.);
if not missing(date) then output;
run;
success log:
NOTE: The data set WORK.BY_AAA has 152 observations and 2 variables.
NOTE: DATA statement used (Total process time):
real time 0.88 seconds
cpu time 0.03 seconds
But when I am trying to pass date condition with the same query it is
giving error: new SAS code is as below: But I am able to achieve desired
results with R/ Python/ Matlab with their respective code.
filename DAAA url "http://www.quandl.com/api/v1/datasets/FRED/MSWP5.csv?
&trim_start=2000-07-01&trim_end=2013-02-01&sort_order=desc";
data BY_AAA(drop=dd);
length dd $10;
format date date9.;
infile DAAA dlm="," dsd;
input dd$ value;
date=input(dd,yymmdd10.);
if not missing(date) then output;
run;
it gives below error:
not working due to "&" sign is coming so SAS is saying
WARNING: Apparent symbolic reference TRIM_START not resolved.
WARNING: Apparent symbolic reference TRIM_END not resolved.
WARNING: Apparent symbolic reference SORT_ORDER not resolved.
I understand that this is an issue related to escape character handle. Can
any body help me...
No comments:
Post a Comment