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

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;

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

Maybe you should check proc http when you are connecting a httpS website.

View solution in original post

3 REPLIES 3
BillJones
Calcite | Level 5

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

Ksharp
Super User

Maybe you should check proc http when you are connecting a httpS website.

BillJones
Calcite | Level 5

Ksharp,

Thanks very much for the suggestion.  PROC HTTP works perfectly.

Regards,

Bill

SAS Innovate 2025: Call for Content

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!

Submit your idea!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 13807 views
  • 0 likes
  • 2 in conversation