Hello Everyone,
I'm trying to run the code below using a proxy. Whenever I run it, I get an SSL error stating that "The token supplied to the function is invalid (0x80090308)." Note when I remove the proxy the code works fine (thanks again KSharp). Also, I can view the requested webpage using the proxy in Chrome. What's the best way to handle this error? Use CURL or the SAS/SECURE™ SSL Add-in module? I'm running SAS 9.3. Thank you for any help or suggestions!
-Bill
DM 'CLEAR LOG';
%let x=&d; %let s=%superq(x);
%let a=&e; %let p=%superq(a);
filename in url "https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.option_contracts%20WHE..."
proxy="my proxy:port"
lrecl=32000;
data temp;
infile in recfm=n dlm='<>';
length symbol expiration $ 20;
retain symbol;
input token : $1000. @@;
if prxmatch('/(^\d{4}-\d{2})|(option\s+symbol=)/o',token) then do;
if left(token) =: 'option' then do;symbol=scan(token,2,'"'); delete;end;
expiration=token;
output;
end;
drop token;
run;
Maybe you should check proc http when you are connecting a httpS website.
Ok, I've determined that CURL is the best way to solve this issue and have installed it on my machine. Now I'm trying to run some test code. There are no errors in my log, see below. However, I can't seem to generate the data that I want. It appears that curl is working and a text file is created. Except the text file is blank. Does anyone have any suggestions on what I'm doing wrong?
Thanks so much,
Bill
87 dm 'clear log';
88
89 %let loc=https://www.yahoo.com/;
90 data _null_;
91 infile %sysfunc(quote(curl -k &loc. > C:\Users\bjones\SAS\Data\data_temp.txt))
91 ! pipe ;
92 input ;
93 put _infile_;
94 run;
NOTE: The infile "curl -k https://www.yahoo.com/ >
C:\Users\bjones\SAS\Data\data_temp.txt" is:
Unnamed Pipe Access Device,
PROCESS=curl -k https://www.yahoo.com/ > C:\Users\bjones\SAS\Data\data_temp.txt,
RECFM=V,LRECL=256
NOTE: 0 records were read from the infile "curl -k https://www.yahoo.com/ >
C:\Users\bjones\SAS\Data\data_temp.txt".
NOTE: DATA statement used (Total process time):
real time 0.16 seconds
cpu time 0.01 seconds
Maybe you should check proc http when you are connecting a httpS website.
Ksharp,
Thanks very much for the suggestion. PROC HTTP works perfectly.
Regards,
Bill
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.