Hello Experts,
Do you know please how to import the file from web. I'm using the code like :
data scores;
infile "http://XXXX/Liste.txt" truncover;
format name $8.;
informat name $8.;
input name ;
run;
But it doesn't work.
Thank you very much for your help !
Thank you !
My problem is that this file doesn't existe until clicking on http://XXXXXX. 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).
I'm wondering if there is possible to import this kind of file.
Doesn't work is awful vague.
Are there errors in the log?: Post the code and log in a code box opened with the "</>" to maintain formatting of error messages.
No output? Post any log in a code box.
Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the "</>" icon or attached as text to show exactly what you have and that we can test code against.
Perhaps Proc HTTP can help.
You can provide instructions like "GET" to request data but I don't use this and there are likely to be a number of additional pieces of information that you may need to provide to get the correct connection.
You need to use the URL filename engine. Otherwise is just going to look for a file on the local computer with that name.
infile "http://XXXX/Liste.txt" url truncover;
@SASdevAnneMarie wrote:
Thank you Tom ! The file is generated by php only if I request it with http://XXXXXX, so it's "instantly generated txt file". I don't know If I can use the proc http with that.
It is not 1992 anymore. Most of the url's on the web are not pointing at actual files. So try it and see.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.