Hello Experts,
You know that in web, there is the request (the client's request -> server) and the response (server -> client's browser). The response from http://XXXXXX is a file stream type txt (generated with php).
So physical file doesn't exist, while clicking on http://XXXXXX
I'm wondering if there is possible to import this kind of file ?
Thank you for helping !
If you use SAS 9.4(M3 and later), you can use proc http.
Try this code.
filename webdoc 'c:/temp/want.txt' encoding='utf-8';
proc http
method="get"
url="https://www.google.com/"
out=webdoc;
run;
data test;
infile webdoc;
attrib buf length=$4096;
input buf $4096.;
put buf=;
run;
you can get 'c:/temp/want.txt' as a text file, and 'WORK.TEST' as a dataset.
If you use SAS 9.4(M3 and later), you can use proc http.
Try this code.
filename webdoc 'c:/temp/want.txt' encoding='utf-8';
proc http
method="get"
url="https://www.google.com/"
out=webdoc;
run;
data test;
infile webdoc;
attrib buf length=$4096;
input buf $4096.;
put buf=;
run;
you can get 'c:/temp/want.txt' as a text file, and 'WORK.TEST' as a dataset.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.