Running the SAS
Program in Batch Mode
Creating the Command File
- To run SAS in batch mode, the user must first create a text
file containing the necessary SAS commands by using an editor such
- For specific instructions on how to write a command file, please refer
to the SAS Syntax page of this document.
Executing the Command File
- To run the command file, type
sas filename from
the % prompt.
- If the command file has another extension, such as
then you will have to type the full name of the file. For example:
The LOG and LST Files
- After SAS performs the commands listed, it writes a LOG file
.log)which provides information
to the user about the SAS job, including error messages and warnings,
details about the time the computer took to run the command file as well
as the SAS data sets written. The listing file (
contains the output of the statistical procedures.
- The LOG file should be read before reviewing the output to determine
whether or not the analysis ran as expected. Correct any errors in the
command file and re-run it before examining the listing file.
- The output in the LST file should be carefully reviewed to verify that
the results are meaningful. A program which executes without errors
does not guarantee a correct or meaningful analysis .
- The LOG and LST files can be viewed using the
at the % prompt. For example:
- Alternatively, the LOG and LST files can also be read using a text