- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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?
Thank you,
Kevin
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Doh!
%sysexec works:
%sysexec mkdir "H:\SAS\test" ;
Sorry,
Kevin
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Indeed, both of the following worked:
5389 x 'mkdir "H:\SAS\test1"' ;
5390 %put SYsrc=&SYSRC. ;
SYsrc=1
5391
5392 %sysexec mkdir "H:\SAS\test2" ;
5393
5394 %put SYsrc=&SYSRC. ;
SYsrc=1
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
"H:\SAS\D1\sas\one.lst" ;
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.
Thank you,
Kevin
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You might want to check the XWAIT and XSYNC options.
Also the location of where SAS is actually installed can vary.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
Thank you,
Kevin