Hello, I would like to calculate the actual distance and travel time using Google Map. I have a table with the GPS coordinates of the cities concerned (latitude, longitude): Lat1 longLat2 Long2 Long2 I want to calculate the distance between (lat1, long1) and (lat2, long2). from: https://communities.sas.com/t5/SAS-Communities-Library/Driving-Distances-and-Drive-Times-using-SAS-and-Google-Maps/ta-p/475839 I have made some progress, but I don't know how to output the coordinates in the variable macros like in this example: "%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; " Even from code given on the link mentioned above, I have a display problem in the result viewers: DRIVING DISTANCE BETWEEN 42.691560,-73.827840 AND 35.805410,-78.797679 : .
... View more