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..
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.
Did you considered DLGCDIR() function?
All the best
Bart
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 / ";
Run your command with a pipe, and inspect the log:
data _null_;
infile "cd /PARENTFOLDER/SUBFOLDER 2>&1" pipe;
input;
put _infile_;
run;
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!
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.
Ready to level-up your skills? Choose your own adventure.