BookmarkSubscribeRSS Feed
raivester
Quartz | Level 8

I received a SAS date set file. When I double clicked the file, I got the error message:

 

ERROR: Unable to open the table TMP4.FILE_NAME. TMP4.file_name cannot be opened. Do you want to select a different table to open?

 

When I moved the file to a different folder in a different directory, I had no issues. Any ideas why this happened?

14 REPLIES 14
raivester
Quartz | Level 8

Actually--the file does NOT open.

Shmuel
Garnet | Level 18

1) By what code/tool you tried to open the file?

    Is it a sas data set or an external file? 

    What is your sas environment? (SAS EG / SAS STUDIO / ...) and

    What OS are you using -  (windows / unix or linox / other)?

2) If it is a sas data set, maybe it is damaged and

    Did you assigned a libname, named tmp4, to the directory where to

    you copied the file?

3) Is the file created in a different sas environment?

 

 

jimbarbour
Meteorite | Level 14

I don't think this is the problem, but just to rule things out, would you please run this code:

PROC 	OPTIONS	OPTION=DLDMGACTION;
RUN;

If, when you run the above, you find the option is set to FAIL or ABORT, you may wish to consider other options.

 

If SAS encounters a damaged dataset, it will take the action specified by the DLDMGACTION.  I typically use REPAIR.  If the option is set to REPAIR, SAS will automatically try to repair a damaged dataset including rebuilding indices and constraints. You could have a performance problem if SAS tries to rebuild an index on a very large dataset, so for production jobs, one has to consider the trade offs.   For batch jobs, I typically use NOINDEX which means that SAS will repair the dataset but not rebuild any indices or constraints.

 

Jim

Reeza
Super User

How are you opening your data set?

 

Try using code so you can see the errors.

 

libname yourData 'path to folder';

data want;
set yourData.dataSetName;
run;

What do you get when you run the following?

 


@raivester wrote:

I received a SAS date set file. When I double clicked the file, I got the error message:

 

ERROR: Unable to open the table TMP4.FILE_NAME. TMP4.file_name cannot be opened. Do you want to select a different table to open?

 

When I moved the file to a different folder in a different directory, I had no issues. Any ideas why this happened?


 

Ksharp
Super User

Maybe that directory don't have right to read or access . Talk to your OS Admin.

Tom
Super User Tom
Super User

If you are running SAS on Unix make sure the filename is all lowercase.  If you ask SAS to open TMP4.FILE_NAME it will look for a file name file_name.sas7bdat in the directory that the TMP4 libref is pointing to.  If you are running on Unix the filesystem is case sensitive so if the file is named File_Name.sas7bdat or FILE_NAME.sas7bdat then it will not be found.

Wonder94
Fluorite | Level 6

Hi Raivester! I've encountered a similar problem and the dataset cannot open regardless. Were you able to get around it?

Tom
Super User Tom
Super User

@Wonder94 wrote:

Hi Raivester! I've encountered a similar problem and the dataset cannot open regardless. Were you able to get around it?


Since the original poster never responded three years ago I doubt they will respond now.  Open a new thread and include the details or what you are doing.

DrAbhijeetSafai
Lapis Lazuli | Level 10

Same here! I will write here as the issue gets solved for me.

 

Thanking you,

Yours sincerely,

 

- Dr. Abhijeet Safai

Dr. Abhijeet Safai
Certified Base and Clinical SAS Programmer
Associate Data Analyst
Actu-Real
DrAbhijeetSafai
Lapis Lazuli | Level 10

The problem is solved partially for me because I know why the problem is occurring. 

 

I am running a programme in batch mode, which is creating multiple outputs. Now this programme is using a format which is a dynamic format getting created and being used from data. The dataset is not opening because the format is not getting loaded. The workaround for now for me is to run the programme and then open the dataset. 

 

But yes, the issue is because a format is not getting loaded. It is a dynamic format. 

 

So solution is not to use dynamic format (format getting created from data) and to use static values in the format.

 

Thanking you,

Yours sincerely,

 

- Dr. Abhijeet Safai

Dr. Abhijeet Safai
Certified Base and Clinical SAS Programmer
Associate Data Analyst
Actu-Real
DrAbhijeetSafai
Lapis Lazuli | Level 10

To rearticulate the problem:

 

The dataset contains a variable which has a format. This format is user defined. As this format (user defined) is not available to SAS (it is available only in that programme), the dataset is not opening. 

 

But it is opening when the programme is run before, because then this user defined format becomes available to SAS.

 

Thank you.

 

- Dr. Abhijeet Safai

Dr. Abhijeet Safai
Certified Base and Clinical SAS Programmer
Associate Data Analyst
Actu-Real
DrAbhijeetSafai
Lapis Lazuli | Level 10

Ok. Thanks.

 

- Dr. Abhijeet Safai

Dr. Abhijeet Safai
Certified Base and Clinical SAS Programmer
Associate Data Analyst
Actu-Real
DrAbhijeetSafai
Lapis Lazuli | Level 10

This is working! 

options nofmterr;

 is working absolutely fine @Kurt_Bremser !  

 

Thanks once again! 😊

 

Thanking you,

Yours sincerely,

 

- Dr. Abhijeet Safai

Dr. Abhijeet Safai
Certified Base and Clinical SAS Programmer
Associate Data Analyst
Actu-Real

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 14 replies
  • 6840 views
  • 9 likes
  • 9 in conversation