SAS is a software platform and programming language used to access, prepare, analyze, and report data. A typical SAS program combines DATA steps, which create or transform datasets, with PROC steps, which analyze data or produce reports.

What does SAS mean in data analytics?

SAS was historically associated with the name Statistical Analysis System. Today, SAS is used as the company and product brand rather than as an expanded acronym in most current product documentation.

In this tutorial, SAS refers to the analytics software developed by SAS Institute. It does not refer to Scandinavian Airlines, the British Special Air Service, or SaaS, which means Software as a Service.

What SAS software is used for

  • Data access: Import data from text files, spreadsheets, databases, and supported data services.
  • Data preparation: Filter rows, create columns, combine tables, correct values, and reshape datasets.
  • Statistical analysis: Calculate descriptive statistics and run supported statistical procedures.
  • Reporting: Produce tables, listings, charts, and formatted output.
  • Analytics workflows: Build repeatable programs for processing and analyzing data.
  • Data management: Sort, merge, summarize, and validate structured data.

DATA steps and PROC steps in a SAS program

Most introductory SAS programs are built from two types of steps. A DATA step reads or creates data and can transform it one observation at a time. A PROC step invokes a SAS procedure to analyze, summarize, sort, print, or otherwise work with a dataset.

SAS program elementPrimary purposeCommon examples
DATA stepCreate or transform a datasetRead values, calculate columns, filter rows, and combine data
PROC stepRun a predefined procedurePrint, sort, summarize, analyze, or visualize data
Global statementApply an instruction outside a single stepDefine a title, footnote, filename, or library reference

Create and print a SAS dataset

The following program creates a temporary dataset named students. The datalines statement supplies the input records, and PROC PRINT displays the completed dataset.

</>
Copy
data students;
    input name $ score;
    datalines;
Anita 82
Ravi 91
Meera 88
;
run;

proc print data=students;
run;

The dollar sign after name identifies it as a character variable. Without the dollar sign, SAS treats an input variable as numeric by default.

Calculate a new variable and filter SAS observations

A SET statement reads observations from an existing SAS dataset. Assignment statements create or update variables, while an IF statement can select the observations written to the new dataset.

</>
Copy
data qualified_students;
    set students;
    percentage = score;

    if score >= 85;
run;

proc print data=qualified_students;
    var name score percentage;
run;

This program reads students, creates percentage, and writes only rows with a score of at least 85 to qualified_students.

Temporary and permanent SAS datasets

A SAS dataset normally has a two-level name in the form library.member. The library identifies the storage location, and the member identifies the dataset.

  • work.students is stored in the temporary WORK library. It is normally removed when the SAS session ends.
  • sales.orders refers to the ORDERS dataset in a library named SALES.
  • A one-level name such as students normally refers to work.students.

A library reference can associate a short SAS name with a directory available to the SAS session.

</>
Copy
libname training "/path/to/sas-data";

data training.students;
    set work.students;
run;

Replace the example directory with a valid location for the environment in which SAS is running. File access and path syntax can differ between local, server, and cloud-based SAS environments.

Common SAS procedures for beginners

SAS procedureTypical use
PROC CONTENTSInspect dataset structure, variable types, and attributes
PROC PRINTDisplay observations and selected variables
PROC SORTSort observations by one or more variables
PROC FREQCreate frequency and cross-tabulation tables
PROC MEANSCalculate descriptive statistics for numeric variables
PROC SQLQuery, join, summarize, and create tables with SQL

How a SAS program is processed

A semicolon ends most SAS statements. A RUN statement marks a step boundary for many DATA and PROC steps, while QUIT is required to terminate certain interactive procedures. SAS compiles and executes each step, writes diagnostic information to the log, and sends generated results to the output destination.

  • Program editor: Contains the SAS statements submitted for processing.
  • Log: Shows notes, warnings, errors, execution details, and row counts.
  • Results or output: Displays tables, reports, and graphs created by procedures.
  • Libraries: Provide access to temporary or persistent SAS datasets.

Reading the SAS log after every program run

Visible output does not by itself prove that a program processed the intended data. Review the SAS log after each submission. Start with explicit errors, then examine warnings and notes that report invalid values, missing data, automatic type conversion, uninitialized variables, or an unexpected number of observations.

SAS program QA checklist

  • Confirm that the expected input library and dataset were used.
  • Check the log for ERROR and WARNING messages.
  • Investigate notes about invalid data, uninitialized variables, and character-to-numeric conversion.
  • Compare the observations read and written with the expected row counts.
  • Use PROC CONTENTS to verify variable names, types, lengths, labels, and formats.
  • Inspect a sample of the output with PROC PRINT before using the data in later analysis.

Suggested SAS learning sequence

  1. Learn SAS statement structure, comments, semicolons, and step boundaries.
  2. Create datasets with DATA steps and inspect them with PROC CONTENTS and PROC PRINT.
  3. Read external data and understand numeric and character variables.
  4. Filter observations and create calculated variables.
  5. Sort, concatenate, merge, and summarize datasets.
  6. Apply SAS formats and labels without changing stored values.
  7. Use PROC FREQ and PROC MEANS for basic summaries.
  8. Learn PROC SQL for filtering, joins, grouping, and table creation.
  9. Study statistical procedures appropriate to the analysis being performed.
  10. Learn macro processing only after becoming comfortable with ordinary SAS programs.

Students looking for learning resources and academic access information can also consult the official SAS resources for students.

SAS software, SaaS, SAS Airlines, and SAS military meaning

TermMeaning
SAS softwareData management and analytics software associated with SAS Institute
SaaSSoftware as a Service, a software delivery model
SAS airlineScandinavian Airlines, an aviation company
SAS militarySpecial Air Service, a British military unit

The capitalization is similar, but these terms refer to different subjects. In programming and data-analysis material, SAS normally means the software and language.

Frequently asked questions about SAS software

What is the full form of SAS?

SAS was historically associated with “Statistical Analysis System.” In current usage, SAS is generally treated as the company and product brand rather than expanded as an acronym.

Is SAS a programming language or software?

It is both. The SAS language is used to write DATA and PROC steps, while SAS software provides the environment, procedures, data-access features, and interfaces that execute those programs.

What is the difference between SAS and SaaS?

SAS is an analytics software brand and programming environment. SaaS stands for Software as a Service and describes software delivered as an online service. The terms are unrelated despite their similar spelling.

What should a beginner learn first in SAS?

Begin with SAS syntax, libraries, datasets, DATA steps, and basic procedures such as PROC CONTENTS, PROC PRINT, PROC SORT, PROC FREQ, and PROC MEANS. Learn to interpret the SAS log before moving to SQL, statistical procedures, or macro programming.

Why does a SAS program use RUN and QUIT?

RUN marks a step boundary and causes many DATA or PROC steps to execute. Some procedures remain active across multiple statements and require QUIT to end the procedure completely. The appropriate terminator depends on the procedure.