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.
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.
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.
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;
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?
So what is the name of library of interest?
One thing I would look for is a .sas7bdat file there where the filename is not all lowercase.
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.
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.
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 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.