Desktop productivity for business analysts and programmers

Unable to open a SAS dataset from a library

Accepted Solution Solved
Reply
Contributor
Posts: 66
Accepted Solution

Unable to open a SAS dataset from a library

Hi All,

 

I am unable to open a SAS dataset from a permenant library, while i can see the data set on this location, I am encountering a n error "Sas data det is not found or exists". i am able to access this dataset if copy it from the existing location to another, i have checked the permissions on the folders and the dataset.

I have also tried accessing the data set using the options like fmterr,anyvariable but was not able to.

could you help me on this?

 

 


Accepted Solutions
Solution
‎04-25-2016 01:28 PM
Trusted Advisor
Posts: 1,217

Re: Unable to open a SAS dataset from a library

Having an uppercase letter M in the name of the file (on linux) is a problem.  Linux is case sensitive.  The SAS language is not case senstiive regarding data set names.  But, SAS expects all file names of datasets to be lowercase.  So if I code:

 

libname junk "~/Junk";
data junk.MyData; 
  x=1;
run;

 

SAS will write mydata.sas7bdat.

 

If on the OS you change the name to be MyData.sas7bat (with mixed upper case and lower case), that is a different file name (on linux).  No matter what you do, SAS won't be able to see this datset.  Even referecing the file names explicitly, i.e. "~/Junk/MyData.sas7bdat" will not work.

 

On linux, the file names of all datasets must be lowercase, as I understand it. 

View solution in original post


All Replies
Contributor
Posts: 39

Re: Unable to open a SAS dataset from a library

How are you trying to open the dataset?  Do you have a libname statement?  Can you post your code and log output?

Grand Advisor
Posts: 17,474

Re: Unable to open a SAS dataset from a library

Run a proc contents on the data set from the library in question and post that, if possible.

 

 

Trusted Advisor
Posts: 1,217

Re: Unable to open a SAS dataset from a library

Agree with prior suggestions to show code  & log, and try PROC CONTENTS.

 

Also would be helpful to know what OS you are on.  In Linux, in order to get a LIBNAME statement to work you need to have execute permission on the directory (read permission is not enough).  And I think you need execute permission on every parent directory (haven't confirmed and don't trust my memory). That often trips me up when I'm working on a new server.  

 

I would try first to get a libname statement working.  Once that is working, you can test writing and reading datasets, etc.  

 

Also let us know how you are running your code.  Some clients execute with different permissions from a limited service account (e.g. stored processes run on a stored process server).

Contributor
Posts: 66

Re: Unable to open a SAS dataset from a library

Hi All,

I have tried executing the libname statement, and the library is assigned successfully.
But when have tried using proc contents I m getting an error the dataset dosenot exist.
When I tried opening the dataset. This dataset is provided to by one of my manager the files which were provided earlier were opening in SAS located at the same location.
Esteemed Advisor
Posts: 6,736

Re: Unable to open a SAS dataset from a library

Show.the.log.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 66

Re: Unable to open a SAS dataset from a library

Additional comments

We are using Linux OS.
Trusted Advisor
Posts: 1,217

Re: Unable to open a SAS dataset from a library

I would check that the file name is all lowercase letters. I would also make the file readable by all, just to make sure it isn't a permissions issue. 

Esteemed Advisor
Posts: 5,202

Re: Unable to open a SAS dataset from a library

Where does this data originates from? If you aren't the creator, see if it can be accessed in its original environment.
Data never sleeps
Contributor
Posts: 66

Re: Unable to open a SAS dataset from a library

Hi

The dataset is created by mgr.
The datasets are accessible at his system.
Grand Advisor
Posts: 17,474

Re: Unable to open a SAS dataset from a library

So you have a dataset that you can't access at all.

 

1. Verify the size of the file, if it's 5k then its corrupted or empty

2. Verify the permissions of the file - you may need x command or be able to see the unix directory. 

 

Post a snapshot of the permissions and size. 

More than likely it's a permission issue. 

 

Here's a macro to change the permission of the file to 777 - or accessible by anyone. 

http://support.sas.com/kb/25/198.html

Contributor
Posts: 66

Re: Unable to open a SAS dataset from a library

Hi All,

 

I tried to change the permission on the file and folder using the code from the link below and was not able to change the permission as it was created by another user,the length of the dataset name is 31 char long, and the name has an "M" at the end.

for ex:"yyy.aa_bb_cc_dd_jan2013_mar2016M" (Original name of the dataset changed).

 

When i edit the name and remove "M" i am able to read the dataset, i found this strange even after repalcing the "M" with any other Alphabet or  number, i am still not able to use/read the dataset. I believe this is some issue with SAS.

 

the permission details on the file.

-rwx---rwx 1 ABCDE users 20512768 Mar 16 14:22 aa_bb_cc_dd_jan2013_mar2016M.

 

 

Please suggest.

 

 

 

 

Grand Advisor
Posts: 17,474

Re: Unable to open a SAS dataset from a library

If you can't change the permission you can read the file. Ask your manager to change the permission and send the file back to you.

Solution
‎04-25-2016 01:28 PM
Trusted Advisor
Posts: 1,217

Re: Unable to open a SAS dataset from a library

Having an uppercase letter M in the name of the file (on linux) is a problem.  Linux is case sensitive.  The SAS language is not case senstiive regarding data set names.  But, SAS expects all file names of datasets to be lowercase.  So if I code:

 

libname junk "~/Junk";
data junk.MyData; 
  x=1;
run;

 

SAS will write mydata.sas7bdat.

 

If on the OS you change the name to be MyData.sas7bat (with mixed upper case and lower case), that is a different file name (on linux).  No matter what you do, SAS won't be able to see this datset.  Even referecing the file names explicitly, i.e. "~/Junk/MyData.sas7bdat" will not work.

 

On linux, the file names of all datasets must be lowercase, as I understand it. 

Contributor
Posts: 66

Re: Unable to open a SAS dataset from a library

Hi Quentin,

Thanks a million,
after I changed the case of letter "M" I am able to read the dataset.

Thanks
Santosh
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 15 replies
  • 653 views
  • 2 likes
  • 6 in conversation