BookmarkSubscribeRSS Feed
vijayanand
Obsidian | Level 7

Hi,

 

We have a sas application running in a Linux server. This Linux server has an external NFS mount and one of the sas programs is trying to list the contents of a folder in the NFS mount. In the below example, I can do
“cd /PARENTFOLDER” but not ("cd /PARENTFOLDER/SUBFOLDER ").The access levels on SUBFOLDER are 775 (rwxrwxr_w). The userid  with which the program is being executed has full permission (rwx) on this folder. Not sure why it is still not accessible thru program. However, this path is accessible directly on the server with the same userid.


data _null_;
call system ("cd /PARENTFOLDER/SUBFOLDER ");
run;

This NFS mount is common to another Unix server and my sas program from the unix server is able access this location programmatically.

Any help could be much appreciated.

 

Thanks..

5 REPLIES 5
LinusH
Tourmaline | Level 20

Is the userid the owner or part of the folder owning group?

Also, for other, rw makes no sense since you need execution rights on a folder to be able to access it.

Data never sleeps
vijayanand
Obsidian | Level 7
The userid is the owner and also a part of the owning group..

For others it was r_x not r_w. Sorry ..it was typo
yabwon
Amethyst | Level 16

Did you considered DLGCDIR() function?

All the best
Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



vijayanand
Obsidian | Level 7

Hi,

 

The problem is not with the cd command. It is getting into the given path , but  it is coming out immediately.

 

data _null_;
call system ("cd /PARENTFOLDER/SUBFOLDER ");
run;

 

after the cd command I am running the below command. It seems I am losing the path and it is listing the contents from directory where sas is launched from.

 

filename datafile pipe " ls -p | grep -v / ";

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1301 views
  • 0 likes
  • 4 in conversation