CodeHurry SAS Learning Center

Comprehensive examples covering Base SAS programming, PROC SQL, SAS Macro, PROC IML, SASPy, Python integration, and Jupyter workflows.

Welcome to the SAS Learning Center

Explore structured lessons, complete SAS programs, Jupyter notebooks, diagrams, and supporting materials for Base SAS programming. Topics include the DATA step, PROC procedures, PROC SQL, SAS Macro, PROC IML, SASPy, Python integration, and reproducible programming workflows.

Course Lessons

Lesson 1

Getting Started with SAS

Overview of SAS basics, SAS environment, libraries, and your first SAS programs.

Open Lesson

Lesson 2

Creating SAS Datasets and Writing Them to External Files

Reading raw data using various input styles and SAS procedures, creating permanent and temporary SAS datasets, and writing SAS datasets to text and CSV files.

Open Lesson

Lesson 3

Creating and Transforming Variables

Formats and informats, assignment statements, creating new variables using expressions and functions, IF-THEN/ELSE logic, and DO groups.

Open Lesson

Lesson 4

SAS Functions, Do Loops, and Arrays

Using built-in SAS functions, iterative and conditional DO loops, arrays, and array processing to simplify programming and automate repetitive tasks..

Open Lesson

Lesson 5

Controlling and Managing SAS Datasets

Using dataset options (KEEP=, DROP=, RENAME=, WHERE=, OBS=, FIRSTOBS=), sorting dataset, and reshaping data.

Open Lesson

Lesson 6

Combining SAS Datasets

Combining SAS datasets using one-to-one reading, concatenation (SET), interleaving (SET BY), match-merging (MERGE), updating (UPDATE), modifying (MODIFY), and SQL joins.

Open Lesson

Lesson 7

Summarizing Data, Reporting Results, and Using Output Delivery System (ODS)

Using Base SAS procedures, PROC SQL, and the Output Delivery System (ODS) to summarize data, generate descriptive statistics, create frequency tables, and produce professional reports.

Open Lesson

Lesson 8

Using DICTIONARY Tables for Metadata Queries

Using DICTIONARY tables and SASHELP views to access SAS metadata, explore libraries, datasets, variables, indexes, formats, options, and other system information with PROC SQL.

Open Lesson

Lesson 9

Introduction to the SAS Macro Facility and Macro Variables

Learning the fundamentals of the SAS Macro Facility, creating and using macro variables, and working with automatic macro variables.

Open Lesson

Lesson 10

Macro Variable Functions and Macro Quoting Functions

Using macro variable functions and macro quoting functions to manipulate text, evaluate expressions, and mask special characters.

Open Lesson

Lesson 11

Writing SAS Macros

Creating and invoking SAS macros, defining positional and keyword parameters, using local and global macro variables, controlling macro execution, and developing reusable macro programs.

Open Lesson

Lesson 12

Introduction to SAS/IML

Learning the fundamentals of SAS/IML, including matrix creation and manipulation, matrix operations, programming constructs, and statistical computations.

Open Lesson

Lesson 13

Data Simulation with PROC IML and Using R from PROC IML

Simulating data with PROC IML and using R from within PROC IML to extend SAS with R's statistical and graphical capabilities.

Open Lesson

Lesson 14

SASPy Analytics and Python Programming

Using SASPy to integrate SAS and Python, execute SAS procedures from Python, exchange data between SAS and Python, and perform data analysis using the strengths of both programming environments.

Open Lesson

Lesson 15

Additional SAS Programming and Comparing SAS, Python, and R

Exploring additional SAS programming techniques and comparing the capabilities of SAS, Python, and R for selected tasks.

Open Lesson

Lesson 16

SAS OnDemand for Academics and SASPy

Step-by-step instructions for creating a SAS OnDemand for Academics (ODA) account and configuring SASPy to connect to both a local SAS installation and SAS OnDemand for Academics.

Open Lesson

Lesson 17

JupyterLab, NBViewer, and Windows Commands

Launching JupyterLab, sharing notebooks with NBViewer, converting Jupyter notebooks to HTML, and using selected Windows commands.

Open Lesson
← Back to CodeHurry

Disclaimer

The SAS programming materials provided on this website are intended for educational purposes only. The author assumes no responsibility for any errors, omissions, or damages resulting from the use of these materials. Users are responsible for reviewing, testing, and validating all code before using it in research, academic, commercial, or production environments.

About This Course

This learning center is designed as a companion to the CodeHurry website. Lessons are organized progressively and include executable SAS programs, Jupyter notebooks, HTML versions, and supporting materials to help learners move from fundamental programming concepts to advanced analytics and reproducible workflows.