03-06-2018 12:17 PM
How might I submit a batch job in SAS if the CMD (command prompt) has been disabled? I had written the program to use an X statement.
The administrators have disabled CMD and before I request an exemption, I want to be sure that we do not have other routes. I have no experience with Java, but might the data set Java object be a possible route?
03-06-2018 12:41 PM
Glad you got it to work, but note that the same option that would disable the X statement disables the %sysexec statement. There is not much difference between them.
It should also disable the PIPE engine.
03-06-2018 12:57 PM
Indeed, both of the following worked:
5389 x 'mkdir "H:\SAS\test1"' ;
5390 %put SYsrc=&SYSRC. ;
5392 %sysexec mkdir "H:\SAS\test2" ;
5394 %put SYsrc=&SYSRC. ;
The following, outside of the program that produced it as a CALL EXECUTE with an X statement, pops up a SAS session:
x "D:\Applications\SASHome\SASFoundation\9.4\sas.exe" -CONFIG
"D:\Applications\SASHome\SASFoundation\9.4\nls\en\sasv9.cfg" -NOSPLASH -NOSTATUSWIN -SASUSER !userprofile -SYSIN
"H:\SAS\D1\sas\one.sas" -ALTLOG "H:\SAS\D1\sas\one.log" -PRINT
On other systems/installs, this ran the program in batch mode. I am not sure what happened in my original testing, but when I have an issue, then I pop open CMD and run the code from the command line. X commands work, even though I cannot use CMD. I am not sure why the session is opening.
03-06-2018 04:20 PM
Many SAS sites use SAS Management Console for running SAS batch jobs. Have you considered that as an option? IMO it provides a much better interface if you are running a lot of batch jobs.
03-07-2018 12:48 PM
I have no experience with SAS Management Console, but I would guess that setting up the proper run would require manual interaction.
I guess I have to write up my macros as a PharmaSUG/SGF paper. Programmatically, I can make short work of obtaining the files in a directory and interleaving them by hierarchy level and type (Main versus Validation). I can check, programmatically, several results and "return codes", for instance, stop running Level 2 programs if Level 1 have certain issues. I can have SAS email me based on various conditions or at set time points (elapsed time or programs).
I am not sure why so many SAS shops have a .bat file to accomplish this. The .bat file won't work on the GRID or LSAF, for instance. I am new to EG, but I suspect that .bat files would be useless and the macros would need to be updated.
I appreciate the reference. I will be sure to review it.