Return to Archive

SAS Tip of the Month
May 2008

In Windows, running a set of programs in batch mode is a common task. Below is an example of a batch file (filename is RUNALL_Tables.BAT) using two notable items:

  • The use of a windows system variable to store the location of the SAS.EXE program (this is used later in the program to call the SAS.EXE)

  • The options –NOSTATUSWIN and –NOLOGO when running the SAS programs (reduces the number of windows that have to be run)

An example of a batch fiile that I use is given below:

   rem Point to location where SAS.EXE is located
   set xsas=C:\Program Files\SAS\SAS 9.1

   rem Run our programs
   "%xsas%\sas" Demographics.sas -nostatuswin -nologo
   "%xsas%\sas" AdverseEvents.sas -nostatuswin -nologo

One advantage of this type of programming is that if the SAS executable gets moved it would be just a case of changing one line rather than several.

________________________________
Updated May 1, 2008