BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
cadams47
Fluorite | Level 6

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;
1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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;


 

 

 

View solution in original post

3 REPLIES 3
Reeza
Super User

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;


 

 

 

cadams47
Fluorite | Level 6

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?

Tom
Super User Tom
Super User

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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 618 views
  • 4 likes
  • 3 in conversation