I am using SAS 9.4 for Windows 7. When I run anything in batch mode, such as SASUnit, I get a dialog stating
This window is unavailable in line-mode.
My AUTOEXEC.sas contains these two lines which open the work library and maximize the IDE window:
dm 'dmsexp; expand libraries; expand work;';
dm 'awsmaximize on';
The error happens because there is no windowing environment when run in batch. The dm statements don't apply.
It seems like the obvious solution, i.e. test whether SAS is running in batch mode or not, doesn't apply on Windows. The SYSENV variable "reports whether SAS is running interactively." Yet on Windows, SYSENV always contains the value FORE, the value which indicates "when you run SAS interactively through a windowing environment".
Is there a workaround for this other than opening my AUTOEXE.sas and commenting out those two lines every time I need to run something in batch? Maybe there is command-line switch, such as --no-init-file for Emacs, which skips running AUTOEXEC.sas?
-noautoexeccommand line option if you want to use that.