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

In our shop we have a library we use to store datasets that we want to keep longer than our WORK library. I wanted to explore this library a little so I ran this code:

 

proc datasets lib=<libref>;
    contents data=_ALL_
	     memtype = data;
quit;

I get the following error:

ERROR: File <libref>.<data_set_name>.DATA does not exist.

 

Any thoughts on what is causing this?

 

I am using EG on a windows device with SAS running in a grid environment on Linux. SAS v9.4.

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

The capitalization is the problem. Rename (or have renamed) the file to lowercase. As long as it is there in its current form, it will cause problems.

Proc datasets goes searching for all files with .sas7bdat, .sas7bvew or .sas7bcat extensions, and then opens those with the usual means/engines, which then fails. SAS data files must be all lowercase, period.

View solution in original post

10 REPLIES 10
novinosrin
Tourmaline | Level 20

Why didn't you mention the library reference name i.e libref in your code that you would have assigned with a libname statement?

 

Also you could try

 

proc contents data=libref._all_ nods;

run;

 

 


@supp wrote:

In our shop we have a library we use to store datasets that we want to keep longer than our WORK library. I wanted to explore this library a little so I ran this code:

 

proc datasets lib=<libref>;
    contents data=_ALL_
	     memtype = data;
quit;

I get the following error:

ERROR: File <libref>.<data_set_name>.DATA does not exist.

 

Any thoughts on what is causing this?

 

I am using EG on a windows device with SAS running in a grid environment on Linux. SAS v9.4.


 

supp
Pyrite | Level 9
My code doesn't have a libname statement. I assume the library must be getting assigned automatically with the way we have our environment set up. I use the library regularly and have created multiple datasets there.
novinosrin
Tourmaline | Level 20

Okay well I think you have stumped me as I am clueless.

 

Anyways, is it possible for you to run the below and examine the log to see your desired name is in the list?

 

libname _all_ list;

 

 

supp
Pyrite | Level 9

When I run:

libname _all_ list;

I can find the library of interest in my log. I don't think it is a problem with the library, but rather the specific data set associated with the file not found error. I don't understand how the proc datasets can identify the data set name and state it doesn't exist?

novinosrin
Tourmaline | Level 20

So what is the name of library of interest?

supp
Pyrite | Level 9
@Kurt_Bremser, I viewed the linux file location using IPSwitch. Indeed the filename ends with a capital "_TEST". Is the capitalization causing my error? Since this isn't my dataset, is there a way to work around this without changing the file name?
Kurt_Bremser
Super User

The capitalization is the problem. Rename (or have renamed) the file to lowercase. As long as it is there in its current form, it will cause problems.

Proc datasets goes searching for all files with .sas7bdat, .sas7bvew or .sas7bcat extensions, and then opens those with the usual means/engines, which then fails. SAS data files must be all lowercase, period.

supp
Pyrite | Level 9

When I run:

proc contents data=libref._all_ nods;

run;

The program runs but I get no output

 

When I remove the 'nods' I get the same error message as the original proc datasets program.

VSPNandury
Calcite | Level 5
proc contents data=libref._all_;

run;

 The above works for me, and the result window shows details of all the data sets in the library.

However  if I use libref._all_nods I'm getting an error stating that   librf._all_nods.data does not exist. 

 

Well we need to give a small space after _all_  since nods is an option for the proc statement.

So

 

proc contents data=libref._all_ nods;

run;

 

works just fine.

 

 

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 10 replies
  • 5364 views
  • 3 likes
  • 4 in conversation