SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Read Online SAS File into SAS

Accepted Solution Solved
Reply
Frequent Contributor
Frequent Contributor
Posts: 109
Accepted Solution

Read Online SAS File into SAS

It is as simple as the title, but I can't quite get it.

File name and location:

http://www.unc.edu/~mfunk/dr/v1dot1/sample_data.sas7bdat

If this was not an online file, I would be looking to do the following:

data sample_data;

     set 'http://www.unc.edu/~mfunk/dr/v1dot1/sample_data.sas77bdat';

run;

Any help appreciated - thanks

H L


Accepted Solutions
Solution
‎07-15-2015 04:48 PM
SAS Super FREQ
Posts: 684

Re: Read Online SAS File into SAS

Hi

You can use Proc HTTP to get the SAS Data Set and write it directly to the WORK Library. See sample code below.

filename sample "%sysfunc(pathname(work))/sample_data.sas7bdat";

proc http
  method="get"
 
url= 'http://www.unc.edu/~mfunk/dr/v1dot1/sample_data.sas7bdat'
 
out=sample
;
run;

data new;
  set sample_data;
run;

View solution in original post


All Replies
Solution
‎07-15-2015 04:48 PM
SAS Super FREQ
Posts: 684

Re: Read Online SAS File into SAS

Hi

You can use Proc HTTP to get the SAS Data Set and write it directly to the WORK Library. See sample code below.

filename sample "%sysfunc(pathname(work))/sample_data.sas7bdat";

proc http
  method="get"
 
url= 'http://www.unc.edu/~mfunk/dr/v1dot1/sample_data.sas7bdat'
 
out=sample
;
run;

data new;
  set sample_data;
run;
Frequent Contributor
Frequent Contributor
Posts: 109

Re: Read Online SAS File into SAS

Thank you that code worked. I got close but could quite get it right.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 349 views
  • 1 like
  • 2 in conversation