DATA Step, Macro, Functions and more

Importing sas7bdat file

Accepted Solution Solved
Reply
Contributor
Posts: 48
Accepted Solution

Importing sas7bdat file

[ Edited ]

I check this quesion here: https://communities.sas.com/t5/Base-SAS-Programming/Importing-sas7bdat-file/td-p/167889

I want to import this data: myda.sas7bdat . here is my code based on the solution offered by aboved link:

 

 

 LIBNAME SAS "\\Client\D$\sas";
PROC PRINT DATA= SAS.myda;
run;

up to now, it works well, but if I want to modify the dataset, it doesn't work.

DATA myda1;
set SAS.myda;
run;

So i don't know how to use the dataset with suffix sas7bdat, anybody helps? Thank you. 

 


Accepted Solutions
Solution
‎08-29-2016 10:27 AM
Super User
Posts: 17,784

Re: Importing sas7bdat file

Post your full code and log. 

You put the name of the dataset your trying to use in the SET statement. 

 

It it should look like the following:

 

Libname input 'path to folder';

data want;

set input.myda1;

run;

 

View solution in original post


All Replies
Super User
Posts: 17,784

Re: Importing sas7bdat file

Sas7bdat files are SAS datasets. You don't import them. 

You refer to the dataset using the libname.dataset_name format. 

 

So assign a libname to the folder where you store the dataset and then refer to it in the format above. 

Contributor
Posts: 48

Re: Importing sas7bdat file

Thank you. but my codes:
DATA myda1;
set SAS.myda;
run;

I can't get the dataset myda1. what can I do.
Solution
‎08-29-2016 10:27 AM
Super User
Posts: 17,784

Re: Importing sas7bdat file

Post your full code and log. 

You put the name of the dataset your trying to use in the SET statement. 

 

It it should look like the following:

 

Libname input 'path to folder';

data want;

set input.myda1;

run;

 

Contributor
Posts: 48

Re: Importing sas7bdat file

Yes, you are right. It is solved. Thank you.
☑ This topic is SOLVED.

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

Discussion stats
  • 4 replies
  • 579 views
  • 1 like
  • 2 in conversation