I'm in SAS 9.4. The log implies this code ran with no issues. But where is my table saved?
filename data temp;
proc http url = "https://lectures.mhhe.com/connect/richardson_daa1e_1260375196/data_files/Chapter_2/Lab_2_5_CollegeScorecard_RawData.txt"
out=data;
run; quit;
PROC HTTP transfers the file, it does not import it into SAS, it only moves the file to SAS.
In the file called data (myData in the example below), the file is being stored in a temporary space because you've specified temp, not a location/file type.
filename myData temp; proc http url = "https://lectures.mhhe.com/connect/richardson_daa1e_1260375196/data_files/Chapter_2/Lab_2_5_CollegeSc..." out=myData; run; quit;
Instead specify your file type and location to correctly access the file, but then you also need to remember to clean it up after the fact. The TEMP location allows you to not have to worry about that.
filename myData '/folders/myfolders/demo.csv';
Fully explained walkthroughs are here:
https://blogs.sas.com/content/sasdummy/2017/12/04/scrape-web-page-data/
@cadams47 wrote:
I'm in SAS 9.4. The log implies this code ran with no issues. But where is my table saved?
filename data temp;
proc http url = "https://lectures.mhhe.com/connect/richardson_daa1e_1260375196/data_files/Chapter_2/Lab_2_5_CollegeSc..."
out=data;
run; quit;
PROC HTTP transfers the file, it does not import it into SAS, it only moves the file to SAS.
In the file called data (myData in the example below), the file is being stored in a temporary space because you've specified temp, not a location/file type.
filename myData temp; proc http url = "https://lectures.mhhe.com/connect/richardson_daa1e_1260375196/data_files/Chapter_2/Lab_2_5_CollegeSc..." out=myData; run; quit;
Instead specify your file type and location to correctly access the file, but then you also need to remember to clean it up after the fact. The TEMP location allows you to not have to worry about that.
filename myData '/folders/myfolders/demo.csv';
Fully explained walkthroughs are here:
https://blogs.sas.com/content/sasdummy/2017/12/04/scrape-web-page-data/
@cadams47 wrote:
I'm in SAS 9.4. The log implies this code ran with no issues. But where is my table saved?
filename data temp;
proc http url = "https://lectures.mhhe.com/connect/richardson_daa1e_1260375196/data_files/Chapter_2/Lab_2_5_CollegeSc..."
out=data;
run; quit;
Thank you for your answer. So the proc http step only downloads it to where I've put the temp file. (I never could locate it in my temp folder so I specified a filepath I liked, and that worked). But proc http won't change it from a txt file to a .sas7bdat file. I have to use proc import after proc http to convert it?
Right PROC HTTP is just to allow you to interact with the website.
What you do with what it captured depends on what type of file it was.
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.