SAS University Edition: Help Center

What are the components of a SAS program?

A SAS program is a sequence of steps that you submit to SAS for execution. Each step in the program performs a specific task. Only two kinds of steps make up SAS programs: DATA steps and PROC steps.

A SAS program can contain a DATA step, a PROC step, or any combination of DATA steps and PROC steps. The number and kind of steps depend on what tasks you need to perform.

A DATA step enables you to manage and manipulate your data. You typically use a DATA step to read data from an input source, process it, and create a SAS table. With DATA steps, you can

In the sample program below, the DATA step creates a new SAS table TEENSTUDENTS in the temporary Work library by using the existing SAS table CLASS in the Sashelp library. The program includes only students who are older than 12 in the new SAS table.

Sample SAS program with the DATA step highlighted

A PROC (procedure) step enables you to analyze and present your data. You can use a PROC step to generate reports and graphs. PROC steps include a library of prewritten routines (procedures) that perform tasks on SAS tables, such as listing, sorting, and summarizing data. With PROC steps, you can

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

Sample SAS program with PROC step highlighted