logo Getting Started with SAS Main menuGlossarybacknext
Getting to know SAS
 Create and run SAS programs 2 of 12  

Components of SAS programs

Let's begin by looking at a simple SAS program. The sample SAS program below contains two steps: a DATA step and a PROC step. These two types of steps, alone or combined, form all SAS programs.

sample SAS program

DATA steps typically create or modify SAS data sets, but they can also be used to produce custom-designed reports. For example, you can use DATA steps to

  • put your data into a SAS data set
  • compute the values for new variables
  • check for and correct errors in your data
  • produce new SAS data sets by subsetting, merging, and updating existing data sets.

In the sample program, the DATA step creates a new SAS data set ADMIT2 in the CLINIC library using the existing SAS data set ADMIT in the CLINIC library.

sample SAS program

PROC (procedure) steps typically analyze and process data in the form of a SAS data set, and they sometimes create SAS data sets that contain the results of the procedure. PROC steps control a library of prewritten routines (procedures) that perform tasks on SAS data sets, such as listing, sorting, and summarizing data. For example, you can use PROC steps to

  • print a report
  • produce descriptive statistics
  • create a tabular report
  • produce plots and charts.

The sample program uses the PRINT procedure, which prints the data in a data set. The DATA= option tells SAS what data to use for the procedure.

sample SAS program

Main menuGlossarybacknext