BookmarkSubscribeRSS Feed
gzr2mz39
Quartz | Level 8

I'm trying to use filename and connect to a website.

I've tried the following two code samples and received the same error:

"ERROR: The connection has timed out.."

Does anyone know how I fix this?

Thank you.

filename foo url
'http://ichart.finance.yahoo.com/table.csv?s=HIT&a=11&b=29&c=2004&d=01&e=1&f=2005&g=d&ignore=.csv' debug;
data stock_prices;
length Date $9;
infile foo firstobs=2 delimiter=',';
input Date Open High Low Close Volume Adjusted_Close;
run;


filename http socket "support.sas.com:80" termstr=LF lrecl=8192;
data _null_;
infile http length=len;
file http;
if _n_=1 then put
'GET / HTTP/1.1' /
'Host: support.sas.com' /
'Connection: close' / ;
input;
file log;
put _infile_;
run;

2 REPLIES 2
Stig_Eide
Fluorite | Level 6

I have the same issue, did you find a solution? I can open the URL in a browser (it is SSL with username and password).

Thanks,

Stig

gzr2mz39
Quartz | Level 8

You might need to add code for a proxy.

For example:

filename foo url 'http://www.a.com/test.dat'

  proxy='http://www.gt.sas.com';

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 2 replies
  • 3018 views
  • 0 likes
  • 2 in conversation