DATA Step, Macro, Functions and more

Running Windows SAS 9.1 in batch mode

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

Running Windows SAS 9.1 in batch mode

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.

 


Accepted Solutions
Solution
‎08-02-2016 07:04 AM
Super User
Posts: 7,771

Re: Running Windows SAS 9.1 in batch mode

Posted in reply to ddonishchenko

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

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Super Contributor
Posts: 266

Re: Running Windows SAS 9.1 in batch mode

Posted in reply to ddonishchenko
"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"
New Contributor
Posts: 3

Re: Running Windows SAS 9.1 in batch mode

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).


SAS Message Log.PNG
Solution
‎08-02-2016 07:04 AM
Super User
Posts: 7,771

Re: Running Windows SAS 9.1 in batch mode

Posted in reply to ddonishchenko

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

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
New Contributor
Posts: 3

Re: Running Windows SAS 9.1 in batch mode

Posted in reply to KurtBremser

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.

Super User
Posts: 7,771

Re: Running Windows SAS 9.1 in batch mode

Posted in reply to ddonishchenko

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".

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 313 views
  • 1 like
  • 3 in conversation