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

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?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Quentin
Super User

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. 

BASUG is hosting free webinars Next up: Jane Eslinger presenting PROC REPORT and the ODS EXCEL destination on Mar 27 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.

View solution in original post

15 REPLIES 15
Pamela_JSRCC
Quartz | Level 8

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

Reeza
Super User

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

 

 

Quentin
Super User

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).

BASUG is hosting free webinars Next up: Jane Eslinger presenting PROC REPORT and the ODS EXCEL destination on Mar 27 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
santosh_pat69
Quartz | Level 8
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.
santosh_pat69
Quartz | Level 8
Additional comments

We are using Linux OS.
Quentin
Super User
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. 

BASUG is hosting free webinars Next up: Jane Eslinger presenting PROC REPORT and the ODS EXCEL destination on Mar 27 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
LinusH
Tourmaline | Level 20
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
santosh_pat69
Quartz | Level 8
Hi

The dataset is created by mgr.
The datasets are accessible at his system.
Reeza
Super User

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

santosh_pat69
Quartz | Level 8

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.

 

 

 

 

Reeza
Super User

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.

Quentin
Super User

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. 

BASUG is hosting free webinars Next up: Jane Eslinger presenting PROC REPORT and the ODS EXCEL destination on Mar 27 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
santosh_pat69
Quartz | Level 8
Hi Quentin,

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

Thanks
Santosh

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 15 replies
  • 8490 views
  • 2 likes
  • 6 in conversation