College of Natural Sciences
 
FAQs
This is for IE7 to hold div open

SAS FAQ #20: File relationships in SAS

Question:

What are the different files used and produced by SAS and what are they all for?

Answer:

When running SAS in noninteractive mode, (that is when you issue the SAS command followed by an input file name), there are five different files that you are likely to be using.

These are:

  1. text data files
  2. command files
  3. SAS data set files
  4. SAS listing files
  5. SAS log files

A text data file is a document that contains your data in text form. You entered the data from some text editor into this file. Note that it is possible to enter data in a command file, so separate data files are not necessary. However, since data can be read in many different ways, it is usually more efficient to create data files separate from command files.

A command file is a document that contains the SAS commands that will read the data in the text data file, plus commands that will produce some sort of output from the data. You must create the command file using a text editor program, just as with your text data file. As mentioned, the command file can also contain the data.

A SAS data set file is created when a command file contains a DATA step. SAS data set files can be created so that they exist only as long as SAS is running your current noninteractive submission, or they can be created to be saved and used again during a different submission. Note that SAS data set files cannot be edited by text editor programs.

The only way to see the data in a SAS data set file is to use the file in SAS (or some other program that can read SAS data set files).

SAS log files are produced as SAS runs the command file. When the command file is read, SAS checks each statement and tries to execute it. If it can, the statement is sent to the SAS log file with either no comment attached, or a brief note describing the execution process. If the statement can be executed, but problems occurred during execution, the statement is sent to the SAS log file with a warning statement describing the problem. If the statement cannot be executed, SAS sends the statement to the log file along with an error message describing why the command could not be used. Examination of log files following submission of command files is the best way to find mistakes in a command file.

Listing files are produced when SAS executes a command from the command file that creates output. Any command that creates output sends that output to the listing file. The listing file is the file with the information you were trying to produce with the command file.

There are other files used and produced by SAS. For more information, click on the Help button in the SAS menu bar and scroll to SAS Help and Documentation.

If you have further questions, send E-mail to stats@ssc.utexas.edu.