SAS Studio: Help Center

How do I write a SAS program?

SAS programs are made up of SAS statements. A SAS statement has two important characteristics:

Remember that SAS programs include two types of steps: DATA steps and PROC steps. DATA steps begin with the keyword DATA, and PROC steps begin with the keyword PROC. Generally, a step ends with a RUN statement or when a new DATA or PROC step begins. A RUN statement tells SAS to process all of the preceding lines of the step.

Each step in a SAS program is made up of a sequence of statements. SAS statements usually begin with an identifying keyword, and they always end with a semicolon.

Sample SAS program with keywords and statement identified
SAS statements are free-format. This means that

To create a new program in SAS Studio, click Server Files and Folders in the navigation pane. Then click New button and select SAS Program.