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

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. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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

4 REPLIES 4
Reeza
Super User

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. 

DingDing
Quartz | Level 8
Thank you. but my codes:
DATA myda1;
set SAS.myda;
run;

I can't get the dataset myda1. what can I do.
Reeza
Super User

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;

 

DingDing
Quartz | Level 8
Yes, you are right. It is solved. Thank you.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 4 replies
  • 9813 views
  • 2 likes
  • 2 in conversation