0

I am running SAS from R, but i need administrator pivileges to access a folder. I am using this approach

I tried to set user to adminstrator (with help from here), but nothing happens:

sas_log <- tempfile()
sas_out <- tempfile()
sas_script <- "mysasscript.sas"
cmd <- sprintf(
  'sas.exe -nosplash -icon -sysin "%s"  -log "%s" -print "%s" -user:Administrator',
  sas_script, sas_log, sas_out
)

return_code  <- system(cmd)  # Runs sas and saves the return code to 
Jeppe Olsen
  • 968
  • 8
  • 19
  • Can you fire up R as an admin, and just allow SAS to inherit the permissions? – johnjps111 Jan 31 '18 at 17:36
  • No, that doesn't help. This does not give SAS admin rights. – Jeppe Olsen Feb 01 '18 at 08:01
  • Another thought: SAS has it's own administration tools. It may be that your access is OK from a windows or linux (whatever you're on) environment, but that your SAS admins may also need to grant access within SAS, e.g. in User Manager area of SAS Management Console. – johnjps111 Feb 01 '18 at 17:06
  • Maybe one of the solutions proposed in [this post](https://stackoverflow.com/questions/19098101/how-to-open-an-elevated-cmd-using-command-line-for-windows) could work. – Dominic Comtois Feb 04 '18 at 04:49

1 Answers1

0

I've had the same issue. What worked for me is to change the SAS.exe privileges directly in Windows (right-click on icon, properties, etc.). A UAC window does pop up though which is kind of annoying...

bboppins
  • 11
  • 2