Quick answer: Every SAS program is built from two kinds of steps: DATA steps create or modify datasets, and PROC steps analyze them. PROC PRINT displays data, PROC MEANS summarizes it, PROC SORT orders it. Type code in the Editor, press F3 (or the running-man icon) to run, and read results in the Output window. This first-program guide works in any SAS install, including the free SAS Academic Edition.

Your first program, line by line

data students;
  input name $ city $ score;
  datalines;
Asha Chennai 91
Rahul Delhi 84
Meera Chennai 78
Arjun Mumbai 95
;
run;

proc print data=students;
run;

Anatomy: the DATA step names a new dataset (students), input declares columns — the $ marks text columns — and datalines; embeds raw rows right in the code (real analyses read files instead, but inline data is perfect for learning). Every step ends with run; and every statement with a semicolon: the missing-semicolon error is to SAS what the unclosed tag is to HTML — nearly everyone’s first bug.

The three PROCs to learn first

proc means data=students mean std min max;
  var score;
run;

proc sort data=students;
  by descending score;
run;

proc print data=students;
  where score > 80;
  var name city score;
run;
PROCJobRemember
PROC PRINTShow rowswhere= filters, var selects columns
PROC MEANSNumeric summariesvar chooses the numeric columns
PROC SORTReorder the datasetSorts in place — sort a copy if the original order matters

Reading the log window

The LOG window is where SAS talks to you, and reading it is the difference between frustration and flow: blue NOTE lines are normal, green WARNING lines need a look, red ERROR lines name the exact statement that failed. A program can “run” with red errors and produce nothing — so check the log after every run, not just the output.

From here, natural next steps are reading real files with PROC IMPORT and the shared-folder setup described in our SAS University Edition storage guide.

For instructor-led SAS training on real datasets, Ampersand Academy teaches SAS programming and analytics one-to-one.

Frequently asked questions

What is the difference between a DATA step and a PROC step in SAS?

DATA steps create or modify datasets row by row; PROC steps analyze or display existing datasets. A typical program chains them: create with DATA, analyze with PROC.

How do I run a program in SAS?

Select the code and press F3, or click the running-man icon. Selected code runs alone; nothing selected runs the whole program. Results appear in the Output/Results window and messages in the Log.

Why does my SAS code run but produce no output?

Usually a red ERROR in the log killed one step. Open the Log window and read from the first red line – SAS names the statement that failed, most often a missing semicolon or misspelled dataset name.

What does the dollar sign mean in SAS input?

It marks a character (text) column. input name $ score; declares name as text and score as numeric. Without the dollar sign SAS expects numbers.

Is SAS still worth learning in 2026?

In pharma, clinical research, banking and government, SAS remains the validated standard and appears in many job descriptions. For general data science Python and R dominate, but SAS skills stay in demand in regulated industries.