BookmarkSubscribeRSS Feed
surfsas
Calcite | Level 5

Hi,

 

I am using SAS Linux version for the first time. I am trying to load sas7bdat file in my work library, but it is failing every time. PROC IMPORT is not working, import from File menu also failed. 

What is the ideal way to load the file.

Thank you.

 

Note- The SAS dataset does open/load in SAS Studio.

2 REPLIES 2
SASKiwi
PROC Star

You don't use PROC IMPORT to load a sas7bdat file. It's already a SAS dataset so you don't need to import it, just try reading it:

data want;
  set '/user/myuser/mysasdata.sas7bdat';
run;

Beware, if your sas7bdat file was NOT created on linux you may still have problems reading it.

ballardw
Super User

If the file is has an extension of sas7bdat it is already a SAS data set and should be used directly.

 

You can make a library pointing to the location the file is stored

 

libname mylib "root/myfolders/folderwherethebdatfileis";

Open the library and you should see your data set there.

Reference the data set for procedures using MYLIB.datasetname.

Or you can use an explicit path to the file but that gets cumbersome quickly:

proc print data="root/myfolders/folderwherethebdatfileis/nameofbdatefile.sas7bdat";
run;

If the file "doesn't load" in SAS Studio then tell us how you attempted to load it and show us the log from what you attempted.

 


@surfsas wrote:

Hi,

 

I am using SAS Linux version for the first time. I am trying to load sas7bdat file in my work library, but it is failing every time. PROC IMPORT is not working, import from File menu also failed. 

What is the ideal way to load the file.

Thank you.

 

Note- The SAS dataset does open/load in SAS Studio.


 

 

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!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 351 views
  • 0 likes
  • 3 in conversation