I've been Googling for an hour and can't find what should be the easiest thing.
I want to invoke SAS from the command line to edit a SAS program.
If I do this:
C:\Program Files\SAS\SASFoundation\9.2(32-bit)\sas.exe mysasprogram.sas
it simply executes mysasprogram.sas.
Help!
Thanks!
Create files:
E:\sasedit.bat
E:\autoexec.sas
Run command:
The syntax of autoexec code: DM is display manager, WHOST command is calling SAS Enhanced Editor.
To use this with path requiring quotes you'd have to provide path in quotes and add some quoting treatment to autoexec code.
Another way to run some initial commands is via INITSTMT SAS command line option, but there will we have a problem with lots of quoting.
I had some trouble getting vasja's answer to work -- the call to %sysget was unable to retrieve the variable.
I ended up using a single file (launchsas.cmd):
Note that the creation of the "filename" variable is to avoid problems with embedded quotation marks.
After digging through my registry and some more Googling, I got to this solution, that seems to work. However, I haven't played enough to know the differences between SAS.EXE and SASOACT.EXE.