Hi,
I am getting following ERROR message while executing the below code in SAS Eguide 7.12 ; SASVersion:9.4 ; O.S : Linux64 .
Request anyof you to suggest how the below code can be executed ?
Error Message:
ERROR: The connection was reset by a peer..
Code:
%let ll1=%str(42.691560,-73.827840);
%let ll2=%str(35.805410,-78.797679);
* no changes required below this line;
filename x url "https://www.google.com/maps/dir/&ll1/&ll2/?force=lite";
filename z temp;
data _null_;
infile x recfm=f lrecl=1 end=eof;
file z recfm=f lrecl=1;
input @1 x $char1.;
put @1 x $char1.;
if eof;
call symputx('filesize',_n_);
run;
data _null_;
infile z recfm=f lrecl=&filesize. eof=done;
input @ 'miles' +(-15) @ '"' distance :comma12. text $30.;
units = scan(text,1,'"');
time = scan(text,3,'"');
file print;
put "DRIVING DISTANCE BETWEEN &ll1 AND &ll2 : "
distance units" (TIME: " time ")";
stop;
done:
file print;
put "CANNOT FIND THE DRIVING DISTANCE BETWEEN &ll1 AND &ll2 : " /
"TRY ANOTHER PAIR OF COORDINATES";
stop;
run;
filename x clear;
filename z clear;
I've seen that error as a general browser error with nothing to do with SAS.
Since you are using a google URL as a data source that may be more of an internect connection/ status issue.
Since I get a "connection refused" I suspect it may be something on the URL.
Thanks for the Reponse.
I checked and the URL is valid.
URL:https://www.google.com/maps/dir/42.691560,-73.827840/35.805410,-78.797679/?force=lite
I tried again and still the same Error.
Thanks.
Did you check the url from sas server or from your computer?
I checked the URL using the browser (IE) in Local computer.
Donot know how to check using SAS server.
Could you please help?
is there any solution for this error,
i am facing the same issue and looking for some solutions
@SPalanimuthu - If you search SAS Support for this error like I did you will get 110 hits. You will have to give a lot more details of what SAS processing you were doing when you got this error.
I suggest you open a Tech Support track for this. They are in the best position to help with this type of problem.
When you use that URL in a browser, you get a full Google Maps page with multiple elements, but nothing in text form.
From where did you get that code, and why do you think it could work at all?
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.