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
Opal | Level 21

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.


 

 

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

From SAS Users blog
Want more? Visit our blog for more articles like these.
5 Steps to Your First Analytics Project Using SAS

For SAS newbies, this video is a great way to get started. James Harroun walks through the process using SAS Studio for SAS OnDemand for Academics, but the same steps apply to any analytics project.

Find more tutorials on the SAS Users YouTube channel.

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