SAS Programs

You can use SAS programs to access, manage, analyze, or present your data. Let's begin by looking at a simple SAS program.

A Simple SAS Program

This program uses an existing SAS data set to create a new SAS data set containing a subset of the original data set. It then prints a listing of the new data set using PROC PRINT. A SAS data set is a data file that is formatted in a way that SAS can understand.
data sasuser.admit2;
   set sasuser.admit;
   where age>39;
run;
proc print data=sasuser.admit2;
run;
Let's see how this program works.

Components of SAS Programs

The sample SAS program contains two steps: a DATA step and a PROC step.
 data sasuser.admit2; set sasuser.admit; where age>39; run; proc print data=sasuser.admit2; ...

Get SAS Certification Prep Guide: Base Programming for SAS 9, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.