SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Basic Concepts
SAS Programs


Let's begin by looking at a simple SAS program. You can use SAS programs to access, analyze, manage, or present your data. This program creates a new SAS data set from an existing SAS data set and then prints a listing of the new data set.

Sample SAS program

Let's see how this program works.


Components of SAS Programs

Our sample SAS program 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.

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.

So, the steps in your SAS program depend on its purpose:

 DATA step

      A SAS program may consist of
a DATA step

PROC step

or a PROC step
 

DATA step

or any combination of
DATA and PROC steps.

PROC step


   

PROC step


   


back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement