SAS Tutorial for Beginners to Advanced - Practical Guide

In this SAS tutorial, we will explain how you can learn SAS programming online on your own. It includes many base and advanced tutorials which would help you to get started with SAS and you will acquire knowledge of data exploration and manipulation, predictive modeling using SAS along with some scenario based examples for practice.
Table of Contents

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 2019 Magic Quadrant for Data Science & Machine Learning Platforms.
Top SAS Tutorials
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.
SAS OnDemand for Academics
  • 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
Prior to August 2, 2021, there used to be SAS University Edition which you can install on your machine, no internet was required to run it. From effective August 2, 2021, SAS OnDemand for Academics has replaced SAS University Edition.

SAS Tutorial for Beginners

The following articles are designed for beginners who have no programming background or new to SAS programming language. You will learn fundamentals of SAS and how you can develop and run your first SAS program.
  1. Getting Started with SAS
  2. What SAS stands for
  3. Reading / Importing Raw Data into SAS
  4. SAS keyboard shortcuts that every analyst must know

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. They can also be a helpful resource for those who are new to SAS and want to learn more about its usage and applications in data analysis and management.

  1. Importing Excel Data into SAS
  2. Complete Guide: How to use PROC IMPORT in SAS
  3. Read Character Variable of Varying Length
  4. Creating or Modifying a Variable
  5. Dropping variables from a data set in SAS
  6. IF-Then-Else Statements
  7. Where Statement and Dataset Options
  8. WHERE vs. IF Statements
  9. How Data Step and PROC SQL Works
  10. Calculate Frequency Distribution with PROC FREQ
  11. Specify a list of variables
  12. Use of WildCard Character
  13. Character Functions
  14. SAS Date Formats and Informats
  15. Date Functions
  16. INTCK Function with Examples
  17. INTNX Function with Examples
  18. Missing Values in SAS
  19. Convert Character Variable to Date
  20. Convert Numeric Variable to Date
  21. Proc Format
  22. Delete empty rows in SAS
  23. First. and Last. Variables
  24. Proc Sort : Identifying and storing unique and duplicate values
  25. Proc Means : A Detailed Explanation
  26. Use of Multiple Set Statements
  27. Joining and Merging in SAS
  28. SAS Many to Many Merge
  29. Combining and Aggregating Data in SAS
  30. Retain Statement
  31. Proc Transpose Explained
  32. Proc Univariate Tutorial
  33. Proc Rank Explained
  34. Calculating Percentiles with SAS
  35. COALESCE Function
  36. COMPGED Function
  37. SAS Arrays and DO Loops
  38. Proc Tabulate Explained
  39. Length of Numeric Variables
  40. Check number of observations
  41. Pattern Matching with SAS
  42. Send SAS Output to Excel
  43. Handle Variable Name having Spaces
  44. Speed Up SAS Code with Index

SAS Advanced : Proc SQL

The following tutorials are designed specifically for individuals who are just starting out with the SQL programming language. PROC SQL is an advanced SAS procedure for SQL which is a powerful tool to manage and manipulate data by running SQL queries. The lessons cover a wide range of topics related to SQL, including an introduction to the language with practical examples, as well as information on PROC SQL Joins, conditional statements, and useful tips and tricks for working with SQL. Whether you are a beginner or have some experience with SQL, these lessons can help you gain a better understanding of the language and how it can be used in various data-related tasks.

  1. Proc SQL Tutorial for Beginners (20 Examples)
  2. Proc SQL Joins (Merging)
  3. Combining Tables Vertically with PROC SQL
  4. Insert Rows in the Table
  5. Alter Table and Update Column
  6. Intermediate PROC SQL Tutorial
  7. Proc SQL Self Joins
  8. Connect to Teradata using SAS
  9. Join on Multiple Columns
  10. Join on Multiple Tables
  11. Comparing two tables
  12. Find records only exist in one table
  13. Random Sampling with PROC SQL
  14. Alternative to _N_ in PROC SQL
  15. NODUPKEY with PROC SQL
  16. Use DISTINCT in CASE WHEN

SAS Advanced : 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.
  1. SAS Macro Programming
  2. Difference between SYMPUT and SYMGET
  3. Multiple Ampersand Macro Variables
  4. CALL EXECUTE made easy
  5. Stop SAS Macro Processing on Error
  6. Count number of variables assigned in a macro variable
  7. Example of a dynamic %DO Loop
  8. Get Variable Names from a Dataset
  9. Run SAS Procedure on Multiple Datasets
  10. Building SAS Macro Library
  11. Dropping Variables Ending with a Specific String
  12. Importing multiple excel files in a single dataset
  13. Importing multiple excel sheets in a single dataset
  14. Imputing Missing Data
  15. Identify and Remove Outliers with SAS
  16. Test for Normal Distribution
  17. Reordering Variables

Practical Problem-Solving SAS Examples

The links below take you to the lessons covering real-world examples of SAS programming. It helps you gain hands-on experience in using the language. By working through these examples, you will not only learn the concepts and principles of SAS programming but also have the opportunity to practice your skills and apply what you have learned to real-world scenarios. The examples are intended to be both informative and practical, providing you with understanding of how to use SAS to manage and analyze data. By using these examples, you can build your confidence and proficiency in SAS programming and improve your ability to work effectively with data.

  1. Read ZIP or GZ Files in SAS
  2. Avoid Truncation while Importing CSV Files
  3. Custom Sort Order in SAS
  4. Count Distinct Values in Variables
  5. Count Missing and Non-Missing across columns
  6. 4 ways to find maximum value in a group with SAS
  7. Extract last 4 characters / digits of value
  8. When to use IF and %IF in SAS Macro
  9. Find Variable with Max or Min across Rows
  10. 4 Ways to calculate LAG and LEAD
  11. Dropping Variables Ending with a Specific String
  12. Identifying and Storing Unique and Duplicate Values
  13. Delete empty rows in SAS
  14. Comparing two data sets
  15. Reordering Variables
  16. Transpose Multiple Variables
  17. Reverse order of data
  18. Extracting numbers and text from alphanumeric string
  19. Dropping variables ending with a specific string
  20. Add leading zeros
  21. Remove leading zeros
  22. Advanced String Manipulation
  23. Fuzzy String Matching 
  24. Calculating Percentiles with SAS
  25. Extract Second Non-Missing Value
  26. Zip / Unzip SAS Datasets
  27. Clearing Log and Output Windows
  28. Variable Names Truncated in PROC Logistic
  29. Driving Distance with SAS
  30. Send Emails with Attachments via SAS
  31. Run R code from SAS
  32. VBA in SAS
  33. Wish Christmas with SAS

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.

  1. Data Exploration with PROC UNIVARIATE
  2. Linear Regression with SAS
  3. Logistic Regression with SAS
  4. Time Series Forecasting : ARIMA
  5. Cluster Analysis using SAS
  6. Ridge Regression with SAS
  7. Principal Component Analysis (PCA) with SAS
  8. Variable Selection (PROC VARCLUS) Explained
  9. Checking Assumptions of Multiple Regression
  10. Checking Homoscedasticity with SAS
  11. Scoring Linear Regression Model with SAS
  12. Detecting Interaction in Regression Model
  13. Bootstrapping Logistic Regression
  14. Chi-Square as Variable Reduction Technique
  15. Oversampling for rare event
  16. Multiple Imputation with SAS
  17. Brier Score for Model Calibration
  18. 2 Ways to score validation sample in PROC LOGISTIC
  19. Understand AUC
  20. Calculating AUC of Validation Dataset
  21. Calculating KS Test

SAS Certification Questions and Answers

These posts 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.
  1. SAS Base Certification Q&A - Part I
  2. SAS Base Certification Q&A - Part II
  3. SAS Base Certification Q&A - Part III
  4. SAS Base Certification Q&A - Part IV
  5. SAS Statistical Business Analyst Certification

SAS Interview Questions and Answers

It covers more than 50 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.
  1. Base SAS Interview Questions and Answers
  2. Advanced SAS Interview Questions and Answers

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

SAS Graphs / Charts

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. Guide : Create Charts with SAS

Other Tutorials

  1. Run ChatGPT inside SAS
  2. How CHATGPT-4 aced SAS Certification with 93% score
  3. Run SAS in Python without Installation

FAQs

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 same as far as programmming (both base and advanced) is concerned. They can be different only in terms of interface or editor you are using in your workplace along with server (obviously). Companies generally use SAS Enterprise Guide which has different interface than SAS OnDemand for Academics. In nutshell, you should focus on learning SAS programming concepts and practice it. Getting comfortable with interface is a matter of a few minutes and companies interview candidates based on programming knowledge not on 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 above and put your question related to the topic in the comment section. SAS also has official community for questions and answers.

ListenData Logo
Spread the Word!
Share
Looks like you are using an ad blocker!

To continue reading you need to turnoff adblocker and refresh the page. We rely on advertising to help fund our site. Please whitelist us if you enjoy our content.