Learning SAS? Welcome to the exclusive online community for all SAS learners.

SAS Table Does Not Open

Reply
New Contributor
Posts: 3

SAS Table Does Not Open

Hi all,

I am new to SAS and appreciate some help on this problem. I did extensive search but have not found the solution to the following issue.

 

I am uisng SAS University Edition.

 

I have a SAS Table in a file called "ex.sas7bdat" and trying to open it in SAS. I used the following code to open the Table:

 

libname loc "/folders/myfolders";
data loc.test2ex;
set loc.ex;
run;

 

I get an error message "The Table "LOC.TESTEX" cannot be opened because it does not contain any columns"

 

I tried to drag and drop the file in the SAS window as well, I get the same error message. I also tried my code with another SAS Table that has columns and the code works fine with the Tbales where there is columns.

 

How do I open the my "ex.sas7bdat" file? If the data in the table does not have columns, what other options or codes do I need to add to opne the Table?

 

Many thanks for any help you can provide.

Mike

New Contributor
Posts: 3

SAS Table cannot be opened

Hi all,

I am new to SAS and appreciate some help on this problem. I did extensive search but have not found the solution to the following issue.

 

I am uisng SAS University Edition.

 

I have a SAS Table in a file called "ex.sas7bdat" and trying to open it in SAS. I used the following code to open the Table:

 

libname loc "/folders/myfolders";
data loc.test2ex;
set loc.ex;
run;

 

I get an error message "The Table "LOC.TESTEX" cannot be opened because it does not contain any columns"

 

I tried to drag and drop the file in the SAS window as well, I get the same error message. I also tried my code with another SAS Table that has columns and the code works fine with the Tbales where there is columns.

 

How do I open the my "ex.sas7bdat" file? If the data in the table does not have columns, what other options or codes do I need to add to opne the Table?

 

Many thanks for any help you can provide.

Mike

 

Super User
Posts: 10,552

Re: SAS Table cannot be opened

Where did you get the data set? You may have created an empty data set with an error.

Is it from the same version of SAS?

Did you do anything with this set using the operating system?

 

New Contributor
Posts: 3

Re: SAS Table cannot be opened

Thanks for the reply. I received this dataset from another person to open. It does contain data. It is unlikley it was created in the same version. But, as far as I can tell, I have the latest SAS University Edition and should be able to opne any .sas7bdat file or table from previous versions.

 

Any thoughts?

 

Kind rtegards

Parviz

 

Super User
Posts: 17,963

Re: SAS Table cannot be opened

If you've tried a couple of things that didn't work it's possible you accidentally erased the file - I've seen this happen many times when someone is first starting out. Replace the file with the original one and try again. 

Super User
Posts: 17,963

Re: SAS Table cannot be opened

If you get an error, it's helpful to post the exact error from the log.

 

Run a proc contents on the file to see if there's anything otherwise it looks like the table is empty. Empty tables or table without columns don't open, which makes sense because there's nothing there to open.

 

If you can upload the file perhaps we can help further, but I'm not sure what else to suggest. 

 

proc contents data=loc.ex;
run;

 

SAS Super FREQ
Posts: 8,745

Re: SAS Table cannot be opened

Hi,
Your SET statement clearly refers to "LOC.EX" and yet the error message you report has "LOC.TEXTEX" -- is this a typo? If you are truly trying to read LOC.EX, then the ERROR message should reflect that. The idea to run a PROC CONTENTS is a good one. Also if you can see your file in the Folder list, one way to ensure that you have the correct path for the LIBNAME statement is to right-click on the file name and choose Properties to verify that you see something like:
/folders/myfolders/ex.sas7bdat in the Location area of the popup window. If you see a different path, like:
/folders/myfolders/otherdir/ex.sas7bdat then your LIBNAME statement is wrong.

But a PROC CONTENTS on LOC.EX should reveal whether you have any rows or columns in the data file. Perhaps the person who gave you the data sent you an empty file?

cynthia
Ask a Question
Discussion stats
  • 6 replies
  • 847 views
  • 0 likes
  • 4 in conversation