At SAS Global Forum, someone commented to me that he was stunned at the number of people who were unfamiliar with a c:\
Yes, young people, when us oldsters say “c prompt” we are not talking about a cool shellfish
Nope, my dears, in Windows, we expect you to go to that window start menu, click on All Programs, then pick Accessories and then there is something called a Command Prompt.
Don’t feel bad if you don’t remember it. I barely remember it myself. I use SAS On-Demand a lot with my classes. I have a pretty awesome new computer so even with very large data sets I can run things pretty quickly just by clicking on that little running guy.
BUT … every now and then I end up with a job that not only takes a long time but fills up the entire output buffer. I don’t want to clear my log file. I want to read it later. So.. enter batch SAS
It’s very simple if you remember a few things.
1. Go to the directory where your SAS program is located. To do this, you most likely need to change directory from the top-level C:\ To do that, say your file is in a directory called MySASFiles in your documents folder, do this:
obviously, you want to put your name instead of ”you”.
Unlike Unix, Window is not case-sensitive
2. Remember that if you have a space in the directory name you need quotes and, unfortunately, SAS is almost certainly stored in the Program Files directory. Also, remember to end the quote at the end of the whole path, that is, at the end of your file name, so you are going to write the whole statement on one line (don’t worry if it wraps around by itself) like this
“c:\Program Files\SAS\SASFoundation\9.2\sas.exe” -sysin programname.sas -config ”c:\Program Files\SAS\SASFoundation\9.2\sasv9.cfg”
With the -sysin and -config, make sure you have no space between the – and the word that follows.
Then hit enter. The log and lst files will automatically be named programname.log and programname.lst and be created in the directory where your programname.sas file is.
That’s it. Go have a martini. Come back when you are sober and look at your results.