Unlocking the power of SAS Procedures

In the world of SAS data analytics, SAS Procedures (PROCs) are the engines that drive everything from simple summaries to complex machine learning models. Whether you're a seasoned analyst or just stepping into the world of SAS, understanding what procedures are (and how to use them effectively) can dramatically elevate your analytical capabilities.

What are SAS Procedures?

SAS Procedures are pre-built routines that perform specific tasks on your data. These tasks range from descriptive statistics and regression modeling to forecasting, optimization, and machine learning.

Procedures are designed to:

Automate complex tasks like model fitting, scoring, and validation.

Ensure consistency and reproducibility across analyses.

Leverage optimized algorithms for performance and scalability.

Each procedure begins with the keyword PROC, followed by the name of the procedure (e.g., PROC REG, PROC MEANS, PROC FOREST), and is typically followed by options and statements that control its behavior.

Why SAS Procedures matter

Abstract away complexity, allowing users to focus on insights rather than implementation.

Integrate seamlessly with SAS’s data step and macro language.

Support a wide range of domains, from econometrics and forecasting to machine learning and text analytics.

Introducing the SAS Procedure Cheat Sheet

The new SAS Procedure Cheat Sheet is now available and designed to be a simple, easy-to-navigate resource for users and customers working in SAS Viya 4, especially coders in SAS Studio. This guide offers a quick reference to the full range of procedures across SAS’s advanced analytics portfolio, including Optimization, Machine Learning, Econometrics, Forecasting, Statistics, and Visual Text Analytics. Whether you're exploring model deployment, running econometric simulations, or mining text data, the cheat sheet makes it effortless to understand what each procedure does and how it fits into your analytical workflow. It’s the perfect companion for navigating Viya 4 with confidence and speed.

Highlights from the SAS Cheat Sheet

Econometrics & Causal Inference

PROC CAUSALDISCOVERY: Identifies causal relationships in observational data.

PROC DEEPCAUSAL: Performs causal inference, policy evaluation, and policy comparison by applying DNNs, when the treatment variable is binary.

PROC DEEPPRICE: Performs causal inference, policy evaluation, and policy comparison by applying DNNs, when the treatment variable is continuous.

Time-Series & Forecasting

PROC TSMODEL: Construct, transform, analyze, and forecast time series data via distributed processing employing function-based packages such as Automatic Time Series Modeling (ATSM), Time Series Analysis (TSA), Time Frequency Analysis (TFA), etc., and executing user-defined programs.

PROC UCM: Fits unobserved components models for trend and seasonal decomposition.

PROC CESM: Implements exponential smoothing for forecasting.

Machine Learning & Model Deployment

PROC GRADBOOST and PROC LIGHTGRADBOOST: Implement gradient boosting for predictive modeling.

PROC ASTORE and PROC REGISTERMODEL: Enable model deployment and management.

PROC ASSESSBIAS: Evaluates bias in machine learning models to ensure fairness.

Spatial & Attribution Analysis

PROC CSPATIALREG: Performs spatial regression for geographically correlated data.

PROC MKTATTRIBUTION: Analyzes marketing attribution using econometric techniques.

Optimization & Network Modeling

PROC OPTMODEL: A flexible modeling environment for solving linear, mixed-integer, and nonlinear optimization problems.

PROC OPTNETWORK: Solves network-based problems like shortest paths and minimum-cost flows.

Text Analytics & NLP

PROC TEXTBERT: Leverages transformer models for text classification.

PROC TEXTSUMMARY: Uses NLP to summarize documents by extracting key sentences.

PROC TEXTSENTIMENT: Scores text for sentiment using language interpretation models.

Real-world examples

Example 1: Time-Series Forecasting with PROC TSMODEL

proc tsmodel data=mydata outmodel=model_out;
id date interval=month;
var sales;
require esm;
esm sales / model=simple;
run;

Example 2: Machine Learning with PROC FOREST

proc forest data=train_data;
target churn;
input age income tenure / level=interval;
input gender plan_type / level=nominal;
run;

Example 3: Causal Discovery with PROC CAUSALDISCOVERY

proc causaldiscovery;
var x1 - x7;
learn data= observational_data;
run;

Causal inference can be performed using either PROC DEEPPRICE or DEEPCAUSAL, and the syntax is as follows:

proc deepcausal data =observational_data;
id i;
psmodel t=x1-x20 / dnn=(nodes=(32 32 32 32)
train=(optimizer=(miniBatchSize=2000 regL1=0.0001 maxEpochs=1000
algorithm=adam(learningRate=0.0001)) nthreads=5 seed=12345));
model y=x1-x20 / dnn=(nodes=(32 32 32 32)
train=(optimizer=(miniBatchSize=2000 regL1=0.001 maxEpochs=1000
algorithm=adam) nthreads=5 seed=12345));
infer policy=(s1 s0) policyComparison=(base=(t) compare=(s0 s1))
out=mylib.oest outdetails=mylib.odetails;
score outps=mylib.outpsdata outa=mylib.outadata outb=mylib.outbdata;
run;

proc deepprice data= observational_data;
id i;
instrument z;
tmodel p=s t / dnn=(nodes=(32 32 32 32)
train=(optimizer=(miniBatchSize=2000 regL1=0.001 maxEpochs=2000
algorithm=adam) nthreads=5 seed=12346 recordseed=12346));
model y=s t / dnn=(nodes=(32 32 32 32)
train=(optimizer=(miniBatchSize=2000 regL1=0.001 maxEpochs=8000
algorithm=adam) nthreads=5 seed=12346 recordseed=12346));
infer policy=(pstar) policyComparison=(base=(p) compare=(pstar))
out=mylib.oest outdetails=mylib.odetails;
score outeta0=mylib.outeta0data outeta1=mylib.outeta1data
outa=mylib.outadata outb=mylib.outbdata;
run;

Final thoughts

SAS Procedures are the backbone of analytical workflows in SAS. With the growing library of PROCs—especially those powered by AI, deep learning, and advanced econometrics—users can tackle increasingly complex problems with confidence and precision.

Whether you're optimizing a supply chain, forecasting sales, or mining customer feedback, there's a PROC for that. And it's likely one that’s newer, faster, and smarter than you’ve used before.

Learn more

Interactive procedures in SAS

Base SAS Procedures Guide

Updating old SAS programs: A case study with PROC LOESS

Detecting lags in nonlinear time series with PROC TSSELECTLAG in SAS Viya