1

I run SAS batch jobs on a UNIX server and usually encounter the problem that I cannot overwrite sas datasets in batch that have been created by my user locally without changing the authorization level of each file in Windows. Is it possible to signon using my user id and password when initializing the batch job to enable me to get full authorization (to my own files) in batch?

Another issue is that I don't have authorization to run UNIX commands using PIPE on a local remote session on the server and can hence not terminate my own sessions. It is on the other hand possible to run PIPE in batch, but this only allows me to terminate batch jobs so I also wonder if it is possible to run a pipe command in batch using my id and password as the batch user does not have authorizatio to cancel "local remote sessions" on my user?

Example code for terminating process:

%let processid = 6938710;
%let unixcmd = "kill &processid";
%PUT executing &unixcmd;
filename unixcmd pipe &unixcmd.;
1
  • That's a curious way to execute unix commands from SAS. Why don't you use one of the standard methods? (see here) Apr 30, 2015 at 13:25

1 Answer 1

1

there's a good and complete answer to your first point in the following SAS support page.

You can use the umask Unix command to specify the default file permission policy used for the permanent datasets created during a SAS session (be it batch or not). If you are lauching a Unix script which invokes a SAS batch session you can put a umask command just before the sas execution. Otherwise you can adopt a more permanent solution including the umask command in one of the places specified in the above SAS support article.

You are probably interested in something like:

umask 002

This will assign a rw-rw-r-- file permission to all new datasets.

2
  • My problem is that I canno't submit Unix commands in a sas session with (shell escape or pipe) and hence grant everyone else write premission. In batch it is possible to run pipe and I want allow the batch user to get permisssion to overwrite my files. Apr 30, 2015 at 14:05
  • Ok, I thought the problem was in the opposite direction. A dirty solution could be to weaken the file permissions of your account (placing the umask command in the .bashrc or .profile in your home) so to grant the sas account to overwrite yourfiles (maybe including both accounts in the same group?). Apr 30, 2015 at 14:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.