10-17-2016 03:58 PM - edited 10-17-2016 03:59 PM
I would like to be able to do something like this:
x 'p:^cd \sites\^spacechk.bat >c:\sites.txt';
Assuming the ^ character is a command separator. Not sure if it is possible in Windows, much less easy. Anyone done this before?
10-17-2016 05:12 PM
On a related note, is there a way to mask an embedded blank in an argument to a batch file? By default it will throw off the count of the # of arguments...
10-17-2016 06:39 PM - edited 10-17-2016 06:40 PM
That's certainly not a problem. I called it runsas.bat:
echo Initiating run for %3.sas
copy lock %3.lck
"C:\Program Files\SASHome\SASFoundation\9.4\sas.exe" -sysin "%3.sas" -memsize max
The first 4 lines are for debugging and will go away. The object was to run it from SAS with the X command. Argument 1 is the drive letter; argument 2 is the path to the SAS program to be run; argument 3 is the name of the SAS source file w/o a suffix.
The file 'lock' is a single character file used as a blocking semaphore. Or will be when I get this working.
Since the path can have embedded spaces in it, this has been causing me grief trying to get it right.
10-18-2016 11:14 AM
While I wasn't able to find a solution to the original question, I found a way to get (mostly) the same thing done:
x " ""C:\Program Files\SASHome\SASFoundation\9.4\sas.exe"" -sysin ""&runpath\test1.sas"" -log ""&runpath\test1.log"" ";
also works nicely for kicking off an external SAS run. Coupling it with noxwait and noxsync then allows a controlling SAS sheduler to spawn off different SAS runs at will without getting held up waiting for each to complete. This was the final goal.
Need further help from the community? Please ask a new question.