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

For quite a while, I have been using PROC HTTP to download a zip file from a web site so I can access it using the filename zip statement. But recently I have been getting an error message in my log:

 

ERROR: Connection has been closed

 

My code is as follows:

proc http
 method='GET'
 url="https://arlweb.msha.gov/OpenGovernmentData/DataSets/MinesProdQuarterly.zip"
 out=prodtmp;
run;

Here, prodtmp is a filename path where I want to download it. I'm using SAS 9.4M4. Any help you can provide would be much appreciated! Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

The error message, connection closed, is almost certainly not a SAS issue but a web connectivity issue such as bandwidth or the website is busy or undergoing maintenance that restricts users from accessing files.

 

Since the apparent size of the file is 28M you might also get this if the download is just taking too long because of temporary network conditions.

 

Try again. Or if you have something time critical you might attempt to download the file manually and then use the local file.

 

View solution in original post

3 REPLIES 3
ballardw
Super User

The error message, connection closed, is almost certainly not a SAS issue but a web connectivity issue such as bandwidth or the website is busy or undergoing maintenance that restricts users from accessing files.

 

Since the apparent size of the file is 28M you might also get this if the download is just taking too long because of temporary network conditions.

 

Try again. Or if you have something time critical you might attempt to download the file manually and then use the local file.

 

ebowen
Quartz | Level 8

Thanks for your answer. I did go ahead and download the file outside of SAS. I've tried it several more times since then, and I'm still unable to download the file through PROC HTTP. It seems to go for about 2 minutes and then time out. I can't see why there would be a bandwidth problem as I can download it through my browser in about 30 seconds. Anyway, I have a workaround and I'll keep trying it.

ballardw
Super User

@ebowen wrote:

Thanks for your answer. I did go ahead and download the file outside of SAS. I've tried it several more times since then, and I'm still unable to download the file through PROC HTTP. It seems to go for about 2 minutes and then time out. I can't see why there would be a bandwidth problem as I can download it through my browser in about 30 seconds. Anyway, I have a workaround and I'll keep trying it.


I don't really know the internals of Proc Http but most of the browser downloads have built-in adjustments to handle short breaks in accessibility. If you've ever had a download that started off with an "estimated time to completion" or similar that jumps from 10 minutes to 45 minutes that is because it has seen a change in the network throughput and is adjusting. I might guess that either the Proc HTTP doesn't have as robust a fall back or that the connection type it establishes to the server is one that the server terminates under some condition.

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!

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