In this SAS tutorial, we will show you how to learn SAS programming on your own. Whether you're a beginner or an advanced user, this tutorial offers a hands-on approach. It covers a wide range of base and advanced tutorials that will help you get started with SAS. You will gain practical knowledge in data exploration, manipulation, and predictive modeling using SAS. Plus, there are scenario-based examples to practice along the way.
What is SAS?
SAS (Statistical analysis system) is one of the most popular software for data analysis. It is widely used for various purposes such as data management, data mining, report writing, statistical analysis, business modeling, applications development and data warehousing. Knowing SAS is an asset in many job markets. It is tagged 'leader' in Advanced Analytics Platforms as per Gartner Magic Quadrant for Data Science and Machine Learning Platforms throughout all eight years since its inception.![]() |
100+ SAS Tutorials: Base to Advanced |
Why SAS is popular in job market?
SAS has over 40,000 customers worldwide and holds largest market share in advanced analytics. It has been tagged 'leader' consistently for last 6 consecutive years in advanced analytics platforms. In finance (BFSI) industry, SAS retains No. 1 spot and is being used as a primary tool for data manipulation and predictive modeling.- Data Security - Because of unparalleled data security provided by SAS software, it is leading the analytics software industry in BFSI sector.
- Tech Customer Support - SAS provides one of the best tech support. If you are stuck in anything related to SAS whether it is installation related issue or clarity in any of SAS functions and procedures, they have both online and offline community to support you.
- Detailed Documentation - SAS documentation is very detailed as compared to open source software like R and Python.
- Memory Management - SAS can store datasets on hard drive and process bigger data set than size of your RAM.
- Stable Software more important than cost of software license : All the functions and procedures of previous software version are supported in new SAS versions. Cost of software license is a peanut to a bank or pharmaceutical company.
- Legacy System - Many banks have been using SAS for last 20-30 years and they have automated the whole process of analysis and have written millions of lines of working code. To convert all the stable reporting system from SAS to R/Python, it may require significant additional cost.
SAS Modules
When you install SAS software, it has several in-built modules which are designed for various analytics and reporting purposes. See some of the common SAS modules or components.- Base SAS - It is the most common SAS module. It is used for data manipulation such as filtering data, selecting, renaming or removing columns, reshaping data etc.
- SAS/STAT - It runs popular statistical techniques such as Hypothesis Testing, Linear and Logistic Regression, Principal Component Analysis etc.
- SAS/ACCESS - It lets you to read data from databases such as Teradata, SQL Server, Oracle DB2 etc.
- SAS/GRAPH - You can create simple and complex graphs using this component.
- SAS/ETS - You can perform time series forecasting such as ARIMA, Exponential Smoothing, Moving Average etc. using this module.
How to download and install SAS Software
SAS Software is available for free. It's not a trial version but a complete software with almost all the functionalities of paid enterprise version of SAS.- No Installation Required. Set up your account by registering yourself
- You can access it from anywhere as it is run on cloud
- Internet Required
- Don't go by software name 'Academics'. It is available for everyone not just college students
The lesson below provides step by step detailed documentation on how to access SAS software for free.
Free SAS Access - No Install Required
SAS OnDemand for Academics runs on cloud so you need only internet connection and no need to worry about poor configuration of your laptop/desktop. If you have licensed SAS software which is installed on your machine or server, you can run it easily with 4GB RAM and i3 Processor.
They are exactly the same when it comes to programming. The only potential differences may arise in the interface or editor used in your workplace, as well as the server employed. Companies typically use SAS Enterprise Guide, which has a different interface compared to SAS OnDemand for Academics. In a nutshell, your focus should be on learning SAS programming concepts and practicing them. Getting comfortable with the interface takes only a few minutes, and during interviews, companies evaluate candidates based on their programming knowledge rather than their familiarity with a specific interface.
SAS has several modules but it mainly divides into 3 sections - Base SAS, Adanced SAS and SAS Statistics. You can learn Base SAS in a month or sooner depending on the amount of efforts you put in practice SAS. Once you finish with base SAS you can jump to advanced SAS or SAS Statistics depending on your interest. SAS Statistics may take a longer period of time if you don't have prior knowledge of Statistics. SAS Statistical procedures are straight-forward but how they are used in real-world case studies requires professional experience or you can try to solve kaggle case studies using SAS.
You can follow the links below and put your question related to the topic in the comment section.
Base SAS Tutorials
The purpose of these tutorials is to comprehensively cover all the topics that are part of the Base SAS certification. These topics range from data structures, data management, data analysis to report generation. The posts aim to provide clear and concise explanations of each topic, along with practical examples and tips for effectively using SAS in real-world scenarios. These posts are a great study guide for anyone who is getting ready to take the Base SAS certification exam.
SAS Tutorial for Beginners
These tutorials are designed for beginners who have no prior programming background or are new to the SAS programming language. You will learn the fundamentals of SAS and how to develop and run your first SAS program.
- Introduction to SAS Programming
- Applications of SAS in Different Fields
- What SAS stands for
- SAS keyboard shortcuts that every analyst must know
How to Import Data
- How to Upload Data to SAS OnDemand for Academics
- How to use PROC IMPORT in SAS
- Importing Excel Data into SAS
- Importing CSV Files into SAS
- Datalines Statement
- Cards Statement
- Reading / Importing Raw Data into SAS
- Read Character Variable of Varying Length
How to Export Data
Data Manipulation and Analysis with SAS
- Creating or Modifying a Variable
- Dropping variables from a data set in SAS
- How to rename variables in SAS
- IF-Then-Else Statements
- Where Statement and Dataset Options
- WHERE vs. IF Statements
- How to Filter Data in SAS
- Proc Print : Step-by-step Guide
- How to use the IN Operator in SAS
- How Data Step and PROC SQL Works
- Calculate Frequency Distribution with PROC FREQ
- Specify a list of variables
- Use of WildCard Character
- Missing Values in SAS
- Convert Character Variable to Date
- Convert Numeric Variable to Date
- SAS Formats
- SAS Date Formats and Informats
- Proc Format
- Delete empty rows in SAS
- First. and Last. Variables
- Proc Sort Tutorial
- Proc Sort : Identifying and storing unique and duplicate values
- Proc Means : Step-by-step Guide
- Proc Summary : Practical Guide
- Data Exploration with PROC UNIVARIATE
- Proc Contents : Practical Guide
- Proc Transpose Explained
- Proc Rank Explained
- Proc Datasets : Practical Guide
- Proc Compare : Practical Guide
- Proc Append: Combining Data in SAS
- Proc Report Explained
- Proc Tabulate Explained
- Use of Multiple Set Statements
- Joining and Merging in SAS
- SAS Many to Many Merge
- Retain Statement
- Calculating Percentiles with SAS
- SAS Arrays and DO Loops
- Length of Numeric Variables
- Check number of observations
- Send SAS Output to Excel
- Handle Variable Name having Spaces
- Speed Up SAS Code with Index
SAS Functions
Here is a valuable collection of comprehensive tutorials on various functions in SAS. These functions make it easier for you to work with data and perform various operations.
- SAS: Character Functions
- INPUT Function
- PUT Function
- SUBSTR Function
- INDEX Function
- SCAN Function
- FIND Function
- COMPRESS Function
- COUNTW Function
- STRIP Function
- TRANWRD and TRANSLATE Functions
- Convert Strings to Lowercase, Uppercase & Proper Case
- Concatenate Functions - CAT, CATT, CATS, CATX
- Pattern Matching - PRXMATCH and PRXCHANGE Functions
- Fuzzy Matching - COMPGED Function
- SAS: Date Functions
- SAS : Time and DateTime Functions
- SAS: Numeric Functions
Advanced SAS : Proc SQL
These tutorials are ideal for beginners who are new to SQL programming. PROC SQL, an advanced SAS procedure for SQL, offers a robust data management and analysis tool through SQL queries. The lessons provide a comprehensive coverage of SQL, starting with an introduction to the language accompanied by practical examples. You will also find information on PROC SQL Joins, conditional statements, and valuable tips and tricks for working with SQL.
- Proc SQL Tutorial for Beginners (20 Examples)
- CASE WHEN Statement in PROC SQL
- Proc SQL Joins (Merging)
- Combining Tables Vertically with PROC SQL
- Insert Rows in the Table
- Alter Table and Update Column
- Intermediate PROC SQL Tutorial
- Proc SQL Self Joins
- Connect to Teradata using SAS
- Join on Multiple Columns
- Join on Multiple Tables
- Comparing two tables
- Find records only exist in one table
- Random Sampling with PROC SQL
- Alternative to _N_ in PROC SQL
- NODUPKEY with PROC SQL
- Use DISTINCT in CASE WHEN
Advanced SAS : SAS Macros
SAS Macro is used to automate the repetitive tasks i.e. tasks that you perform very frequently (every day or more than once in a day). It includes useful tips and tricks of SAS Macro programming and outlines real world examples of automation with SAS Macros.
- SAS Macro Programming
- SAS: CALL SYMPUT and CALL SYMPUTX
- Difference between SYMPUT and SYMGET
- Multiple Ampersand Macro Variables
- CALL EXECUTE made easy
- Stop SAS Macro Processing on Error
- Count number of variables assigned in a macro variable
- Example of a dynamic %DO Loop
- Get Variable Names from a Dataset
- Run SAS Procedure on Multiple Datasets
- Building SAS Macro Library
- Dropping Variables Ending with a Specific String
- Importing multiple excel files in a single dataset
- Importing multiple excel sheets in a single dataset
- Imputing Missing Data
- Identify and Remove Outliers with SAS
- Test for Normal Distribution
- Reordering Variables
Practical Problem-Solving SAS Examples
The tutorials provided below offer practical lessons that showcase real-world examples of SAS programming. These tutorials aim to provide you with hands-on experience in utilizing the SAS language. By actively engaging with these examples, you will have the chance to practice your skills and apply your knowledge to scenario-based SAS questions.
- Clinical SAS Programming: Complete Guide
- 4 Ways to Select a Random Sample in SAS
- Read ZIP or GZ Files in SAS
- Avoid Truncation while Importing CSV Files
- Custom Sort Order in SAS
- Count Distinct Values in Variables
- Count Missing and Non-Missing across columns
- 3 Ways to Calculate Standard Deviation in SAS
- 4 ways to find maximum value in a group with SAS
- Extract last 4 characters / digits of value
- When to use IF and %IF in SAS Macro
- Find Variable with Max or Min across Rows
- 4 Ways to calculate LAG and LEAD
- Dropping Variables Ending with a Specific String
- Identifying and Storing Unique and Duplicate Values
- Delete empty rows in SAS
- Comparing two data sets
- Reordering Variables
- Transpose Multiple Variables
- Reverse order of data
- Extracting numbers and text from alphanumeric string
- Dropping variables ending with a specific string
- Add leading zeros
- Remove leading zeros
- Advanced String Manipulation
- Fuzzy String Matching
- Calculating Percentiles with SAS
- Extract Second Non-Missing Value
- Zip / Unzip SAS Datasets
- Clearing Log and Output Windows
- Variable Names Truncated in PROC Logistic
- Driving Distance with SAS
- Send Emails with Attachments via SAS
- Run R code from SAS
- VBA in SAS
- Wish Christmas with SAS
- Run ChatGPT inside SAS
- Run Bard inside SAS
- How CHATGPT-4 aced SAS Certification with 93% score
- Run SAS in Python without Installation
SAS Analytics / Statistics Tutorial
This section covers how to perform data exploration and statistical analysis with SAS. It explains how to perform descriptive and inferential statistics, linear and logistic regression, time series analysis, variable selection and reduction, cluster analysis and predictive modeling with SAS etc. It will help you to generate insights out of data using statistical techniques.
- Standardize Variables with PROC STDIZE
- How to Fill Missing Values in SAS
- How to Perform T-test in SAS
- How to Perform ANOVA in SAS
- How to Perform Two-Way ANOVA in SAS
- Correlation Analysis with SAS
- Split Data into Training and Test Datasets in SAS
- How to Calculate VIF in SAS
- Linear Regression with SAS
- Logistic Regression with SAS
- Decision Tree with SAS
- Random Forest with SAS
- Time Series Forecasting : ARIMA
- Cluster Analysis using SAS
- Ridge Regression with SAS
- Principal Component Analysis (PCA) with SAS
- Variable Selection (PROC VARCLUS) Explained
- Checking Assumptions of Multiple Regression
- Checking Homoscedasticity with SAS
- Scoring Linear Regression Model with SAS
- Detecting Interaction in Regression Model
- Bootstrapping Logistic Regression
- Chi-Square as Variable Reduction Technique
- Oversampling for rare event
- Multiple Imputation with SAS
- Brier Score for Model Calibration
- 2 Ways to score validation sample in PROC LOGISTIC
- Understand AUC
- Calculating AUC of Validation Dataset
- Calculating KS Test
SAS Certification Questions and Answers
These tutorials outline the sample SAS Base and SAS Statistical Business Analyst certification questions and answers which helps you prepare for the certification. All questions asked are multiple choice questions, in which there is only one correct answer. It includes questions on SAS functions, procedures, data management, ANOVA, regression, predictive modeling and report generation etc.
- SAS Base Certification Q&A - Part I
- SAS Base Certification Q&A - Part II
- SAS Base Certification Q&A - Part III
- SAS Base Certification Q&A - Part IV
- SAS Statistical Business Analyst Certification
SAS Interview Questions and Answers
It covers more than 100 most frequently asked base and advanced SAS interview questions and answers. It is a collection of SAS Interviews questions beneficial for both freshers and experienced programmer.
Analytics Companies using SAS
It covers questions about "Scope of SAS", list of companies using SAS in India by geography and domain. Analytics Companies Using SAS in India
Data Visualizations with SAS Graphs
It includes tips and techniques to create common graphs or charts with SAS. It also provides methods to decorate charts so that they look professional and add WOW factor to your presentation.