Hi, I'm using SAS 9.1 on Windows Server 2003 Standard Edition. I'm trying to run two programs in a batch mode. My .bat file contains exactly two rows:
Start "D:\PROGRAM FILES\SAS\SAS 9.1" -SYSIN "C:\MyFolder\prog1.sas" Start "D:\PROGRAM FILES\SAS\SAS 9.1" -SYSIN "C:\MyFolder\prog2.sas"
After I double-click on the .bat file icon, the following message appears: "Windows cannot find 'SYSIN'. Make sure you typed the name correctly, and then try again. To search for a file, click the Start button, and then click Search".
How could this be fixed?
Thank you.
Try it without the "start". I don't think it's necessary at all. And you are specifiying a path to a directory instead of the executable.
So I'd go with
"D:\Program Files\SAS\SAS 9.1\sas.exe" -SYSIN "C:\MyFolder\prog1.sas"
instead
"D:\PROGRAM FILES\SAS\SAS 9.1\sas.exe" -SYSIN "C:\MyFolder\prog1.sas"
"D:\PROGRAM FILES\SAS\SAS 9.1\sas.exe" -SYSIN "C:\MyFolder\prog2.sas"
I have updated your command and added sas.exe
1. Call of sas.exe is missing in your command.
2. Do double check if prog1.sas , prog2.sas exists.
3. If still, it do not exist then try keeping the program on the same drive where SAS installed.
4. If your program executes some environment variable are missing then you may have to call config file
"D:\PROGRAM FILES\SAS\SAS 9.1\sas.exe" - config "D:\PROGRAM FILES\SAS\SAS 9.1\sasv9.cfg" -SYSIN "C:\MyFolder\prog1.sas"
Location to save the programs in is a required parameter, so I can't move the .sas file to the drive where SAS is installed. When I execute the code with your updates, I get a new message regarding "Kernel resource initialization failed" (please see attached).
Try it without the "start". I don't think it's necessary at all. And you are specifiying a path to a directory instead of the executable.
So I'd go with
"D:\Program Files\SAS\SAS 9.1\sas.exe" -SYSIN "C:\MyFolder\prog1.sas"
instead
Thanks a lot, Kurt! That's exactly what I needed. Regarding the upgrade - I'm aware we need it, and we are working on it, of course.
And you're in serious need of upgrades. Windows Server 2003 is out of support since last year, and SAS 9.1 is in stage C support, IIRC. Which means the standard answer of SAS TS to any problem will contain "upgrade to 9.4".
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.