Hello, I am trying to read a SAS dataset which is hosted on a Unix server and the script below does not work.
It work fine when the dataset is located a my C drive but not a the Unix server. I would like to able to read a SAS dataset on a Unix Server directly because file transfer on my c drive will cause safety issue.
required(sas7bdat)
Class <- read.sas7bdat("//finsys/bicoe/test/class.7bdat")
I'm not sure the issue is with the function but specifying the path. If you do ls("//finsys/bicoe/test"), is the file shown? If not, you're not specifying the folder path correctly.
I am new to the usage of R language. Also, the difficulty I am facing, is that R is installed on my window based computer while my SAS file is hosted on a UNIX server.
I will need to find a way to permit R to communicate with my Unix server.
But it is not clear for me how to make the ls command as you have suggested and from there read the sas file
Hello, I have made some progress. I am now able to connect to our unix server using ssh_connect. Also, I am able to get the files list using this command:
filelist<-ssh_exec_wait(session,command='ls')
But the next step will be to be able to read the sas dataset.
How do we do that? Do I need absolutely to copy the sas file from the unix server to my windows server ? Is it possible to read it directly on the unix server without making a copy of it ?
Is it possible to change the working directory and if so how.
Find out the IP Address or hostname of your windows machine (e.g. 192.168.0.99)
Find out the full path where your SAS datasets are stored (e.g. /finsys/bicoe/test). This will become your share-name.
Make sure the NFS server on the UNIX server is running
Add a new line to the file /etc/exports on the UNIX server where you write
/finsys/bicoe/test 192.168.0.19(ro)
The above line will export the folder to your windows machine read-only(ro) to prevent accidental changes to the SAS data sets (if undesired, change ro to rw for read-write)
Re-export all the NFS file systems including the new ones via
Steps 0, 1 and 2 are clear, but I don't understand what is required in step 3 (add a new line to the file / tec/reports on the Unix server where you write
/finsys/bicoe/test 1988.168.0.19(ro) ?
I though that we need to send instruction through Microsoft R Open
I am able to read the sas file on my drive P (windows server)
I am not able to do the same task in Microsoft R Open via our unix sever.
Do we really need to export the data on the window server ?
I would prefer to connect via ssh protocol then do the same task as for the P Drive.
Is it possible to do that and if so how ?
I am returning on this project, ie. trying to read a sas dataset in R.
I am now able to connect to our unix server using ssh_connect . However, it seems that I am not able to read the sas data file because my working directory is mapped to a location on the c drive. Is there a way to set my working directory to servername//finsys/bicoe/users/etc.