BookmarkSubscribeRSS Feed
Red1
Calcite | Level 5
0
 

I have a problem importing a file from a website where you need to be registered to launch the download of the csv file, here is my code :

filename foo url 'http://XXXX:8028/'
         USER='XXX' PASS='XXX' debug;

proc import file=foo 
out=bigdata_tel2 
dbms=csv 
replace;
delimiter=";";
getnames=no;
run;

The result is the html code of the page, I also tried that url :http://XXXX:8028/aaa.csv notice that the url doesn't change when I download the file.

Here is the website : 

2.PNG

It's my first time importing a file from a website, any help is welcome. Thanks

2 REPLIES 2
Ksharp
Super User

two options:

1) Check PROC HTTP documentation and see if it could pass username and pw.

2) Use the third side software cURL to download that CSV, and PROC IMPORT it .

Red1
Calcite | Level 5

Thanks for your answer, I tried that : 

filename resp TEMP;
proc http

     method="GET"
     url="http://XXX:8028"
     webusername="XXX"
     webpassword="XXX"
     out=resp;
     run;

proc import file=resp
out=bigdata_tel2 dbms=csv replace; delimiter=";"; getnames=no; run;
 

ty.png

But the result is the same.. . html code 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 487 views
  • 0 likes
  • 2 in conversation