
Gain fundamental SAS base programming skills and exam readiness through a 12-hour, 100-lecture course designed for absolute beginners, with SAS OnDemand for Academics access and practice quizzes.
Access free SAS software with SAS OnDemand for Academics, a cloud-based SAS Studio; learn profile creation, email verification, and sign-in to start using SAS Studio for education.
This lecture shows everything you need to know about how to use SAS OnDemand for academics/cloud-based SAS studio with this course including three steps:
Step 1. How to download course materials (SAS program, data file and PowerPoint slide for each lecture) from each lecture
Each lecture has its own downloadable lecture materials under resource which contains
(1) SAS code for the lecture (.sas file)
(2) data file used in the lecture (the file can be in different formats). A few lectures don't have external data files
(3) PDF file: Power Point slides in PDF format contain knowledge points for each lecture and is presented at the beginning of the lecture.
Step 2. How to upload the SAS programs and data files into SAS OnDemand for academics/cloud-based SAS studio in order to run SAS programs
Step 3. How to modify the file path in SAS programs, and run SAS programs using data files in SAS OnDemand for academics/cloud-based SAS studio
To modify the file path in SAS programs, there are 4 examples, which cover all the scenario you will encounter when modifying the file path in SAS programs
example 1 (infile example): start at beginning of the lecture
example 2 (proc import example): start at about 6:30 of the lecture
example 3 (libname format example): start at about 12:40 of the lecture
example 4 (create sub-folder example): start at about 17:50 of the lecture
Explore cloud-based SAS Studio to create, save as .sas files, and run programs, while reviewing the code, log, and results windows to learn data steps, proc steps, and outputs.
Learn to read data delimited by blanks from a text file into SAS using list input, handle missing values with periods, and validate with a proc print.
Learn how to read comma-delimited csv data with SAS using the infile statement with dsd, which handles missing values and strips quotes, then verify results with proc print.
Learn to read data delimited by other delimiters using the dlm= option in file statement, with optional dsd, demonstrated on a colon-delimited file.
Learn to read data in fixed columns with the column input method in SAS, defining column ranges for name, gender, weight, and DOB; missing values can be left blank.
Learn to read fixed-column data with formatted input and SAS informats, including w.d, $w, and mmddyy10 for parsing and date conversion.
Learn how to display SAS dates by applying formats to fixed-column data. Understand the difference between format and informat, and how to attach mmddyy10. or date9. to DOB.
Create internal SAS data directly in a program using the datalines statement, placing data lines in the data step and verifying with proc print.
Learn to use the LIBNAME statement to assign a library and create permanent SAS datasets. Distinguish temporary work datasets from permanent libraries like score and access score.stu_math in new sessions.
Master importing Excel data into SAS with PROC IMPORT, using datafile, out, dbms, and replace options, and control sheet and range as well as getnames for accurate datasets.
Import delimited external data into SAS with PROC IMPORT, using delimiter and guessingrows options, and fix extra columns or rows with a data step.
Learn to create and redefine variables with assignment statements in a SAS data step. Use the set statement to read existing data and compute total and average scores.
Explore SAS functions overview, including numeric and character functions like sum, min, and upcase; learn how non-missing values affect totals and averages using MDY, nested calls, and function syntax.
Master SAS conditional processing with if-then, do-end loops, in operator, and not equal, and create new variables like gender_num, take, and grade while handling missing values.
Learn how to use if-then/else in SAS to build mutually exclusive groups and improve efficiency, including deriving gender_num, take, grade, and pass from score data while handling missing values.
Specify the length for new character variables with the length statement to prevent truncation. Set gender full to seven to preserve male, female, and missing values.
Master subsetting SAS datasets with the subsetting if statement and the delete statement, including examples like gender = 'f' and complete versus incomplete take values.
Learn to use the SAS label statement to assign variable labels in data steps or proc steps, and display them with a split option in proc print.
Apply the SAS built-in formats using the format statement to assign variables, compare permanent and temporary formats, and explore comma, dollar, and date formats with field width and decimals.
Learn to create user-defined formats with proc format, define value statements for gender and asgroup score categories, and apply formats to variables with format statements.
Store user-defined formats permanently using a libname library, attach them with the format statement in procedures, and use fmtsearch to search work, library, then the permanent library in SAS sessions.
Learn to create a SAS format from an input dataset using proc format with the CNTLIN= option and apply it to another dataset, defining fmtname, start, and label.
(1) length for gender_ac in the code gender_ac = gender||'/'||(gender_code);
gender_ac occupies 14 because
gender occupies 1, gender_code occupies 8, ||'/'|| occupies 5 (|| occupies 1, '/' - 3, || occupies 1)
(2) After running the same code in SAS ondemand (web-based SAS studio), we found there are spaces in the values of gender_ac, and gender_char is not left-aligned.
(The result shown in the video (without above issues) is the one when I used SAS University (an expired installed SAS studio). I found a couple of incidents that these two type of SAS studio acts differently, this is one of them. )
To resolve this, we can add LEFT function to left align the values of gender_code (we can tell the values of gender_code are right aligned -- this is the reason why we got spaces in gender_ac, and not left-aligned gender_char )
Here is the code:
/*add LEFT function to left aline gender_code*/
data scoredata2;
set scoredata0;
gender_ac = gender||'/'||left(gender_code); /*auto*/
gender_char = put (left(gender_code), 8.); /*put*/
run;
Learn how the SAS SCAN function uses delimiters to split a character string into words and return a specified word, with practical examples extracting last names from full_name.
Extract substrings and replace characters with the SAS substr function, using starting position and length, as shown with sale codes and phone area codes in data steps.
Learn how to concatenate character values in SAS using TRIM and CATX to remove trailing blanks, insert separators, and build full names from last_name and first_name.
Learn how the index function searches a string in a SAS variable, returns the first position or zero, and uses upcase or lowcase for case-insensitive matching of 408 area codes.
Learn how the SAS FIND function searches for a substring within a string, returning the first position or zero if not found, unlike index which lacks modifiers and startpos.
UPCASE, LOWCASE, and PROPCASE show how to change character case in SAS: uppercase, lowercase, and proper case, using delimiters to capitalize words in full_name examples.
Use the TRANWRD function to replace patterns in SAS strings, specifying source, target, and replacement. See an example updating phone numbers from 000 to 408 via a length-aware data step.
Learn how to modify numeric values in SAS using the INT and ROUND functions, including extracting integers, rounding to one or two decimals, and applying these to mean derived scores.
Explore how to apply the smallest and largest functions in SAS to extract the second smallest and first largest non-missing scores using k values and a score data set.
Explore the RAND function for pseudorandom numbers from distributions, including uniform between a and b with defaults, and generate 10 values with reproducible streams using call streaminit and a seed.
Explore SAS stores dates as days since 1960-01-01 and times as seconds since midnight, then use MDY to convert month, day, and year into SAS date values with date9 formatting.
Extract year, quarter, month, day, and weekday from SAS date values using year, QTR, month, day, and weekday functions to ensure accurate date handling.
Explore SAS date functions by using today and date to obtain the current SAS date, and apply intck to count years and months between start_date and today.
Explore SAS date functions DATDIF and YRDIF to compute day and year differences between start_date and end_date using bases 30/360, ACT/ACT, ACT/360, and ACT/365, with practical examples.
Learn to generate data with SAS do loops using do and end, specify start, stop, increment and an optional by clause for concise, debuggable iterative code.
Learn to construct SAS do loops with a counter and drop the index variable. Explore explicit output inside the loop and using series values or decrements by -1.
Learn to conditionally execute do loops in SAS with do until and do while, illustrated by reaching 50,000 with yearly deposits and 10 percent interest in 13 years.
Explore combining conditional and unconditional execution in SAS iterative DO statements with UNTIL and WHILE expressions, and see how loops stop at $50,000 or after 10 iterations.
Use SAS array processing and a do loop to perform the same action on multiple variables, converting 999 to missing values in a data step.
Explore creating new variables in an array statement, using default or explicit names, and controlling dimensions, lengths, and character types with dollar signs; learn to compute averages, mean, and diffs.
Learn how to assign initial values to arrays in SAS, create temporary array elements with _temporary_, convert 999 to missing, and compute score differences and averages using array operations.
Learn to define and use two dimensional arrays in SAS, grouping monthly data into quarters and calculating quarterly totals with M and QTR arrays.
Master one-to-one merges in SAS with the data step and set statements. Combine two datasets by their position, include all variables, and limit observations to the smallest dataset.
Concatenate SAS data sets by appending observations with a single set statement, creating CONCAT from scoredata_p and scoredata, resulting in 17 observations and six variables.
Learn how to append one SAS data set to a master base data set with proc append, including the force option for unmatching variables.
Interleave combines multiple SAS datasets by sorting on a common by variable in ascending order and using a by statement with the set statement to produce a unified output dataset.
Master match-merging in SAS using the merge statement, align data by a common variable, and apply ascending or descending sorts to produce a consolidated data set.
Explore one-to-one, one-to-many, and many-to-many match merges in SAS, using by variable stu id and real-world examples with score data and gender information.
Learn to prevent overwriting in SAS match merging by using the rename= option in the merge statement, renaming variables like gender to gender_na across datasets scoredata and scoredata_p_na.
Exclude unmatched observations in SAS match-merging by using the IN= option and a subsetting IF, keeping only records present in both data sets A and B, merged by stu_id.
Select variables during match-merging by using drop= and keep= in the data or merge statements, and apply the in= option to control variable inclusion, ensuring referenced variables behave correctly.
This course is a comprehensive training program designed to prepare you for the SAS BASE programming certification. Whether you’re a beginner or an aspiring data professional, this course will help you develop essential SAS programming skills and advance your career in data-driven industries.
Many companies actively seek SAS-certified professionals, making this certification a valuable asset. If earning your SAS BASE certification is your goal, this course is the perfect choice for you.
Who Is This Course For?
This course is suitable for:
(1) Beginners with no prior SAS experience.
(2) Individuals preparing for the SAS BASE certification exams, including:
SAS Certified Specialist: Base Programming Using SAS 9.4 (Exam ID A00-231)
--- The course covers all exam topics in detail.
SAS Certified Associate: Programming Fundamentals Using SAS 9.4
(Exam ID A00-215), which is a junior-level SAS BASE certification.
--- This course covers more topics than required for the A00-215 exam.
Note: A00-215 is NOT a prerequisite for A00-231. Many students have enrolled in this course and passed the full SAS 9.4 Base Programming (A00-231) certification directly.
What You’ll Learn
Step-by-step, code-by-code explanations for easy and efficient learning.
Quizzes, coding exercises, and projects for hands-on practice.
Downloadable course materials, including:
PowerPoint slides
SAS programs
Data files used in all lectures
Software Requirements: SAS Studio
This course was originally created using the SAS University Edition (downloadable version of SAS Studio). However, it has since been updated to SAS OnDemand for Academics which is a free, web-based version of SAS Studio.
The course is fully compatible with SAS OnDemand for Academics.
The software's interface, appearance, and functionality remain consistent between the two versions.
Detailed setup instructions are provided in Section 2.
A Note on Course Ratings and Reviews
Many students who enrolled in this course successfully passed the SAS Base Certification Exam (Exam ID: A00-231) on their first attempt. They've shared their success stories with me, and I’m both encouraged and grateful that this course played a key role in helping them achieve this milestone.
I’d love to hear your success story too! Please consider sharing your experience and the joy of this important career accomplishment in your course review. Your feedback not only motivates me, but it also helps guide and inspire others who are preparing for the exam.
This course is regularly updated to reflect the latest SAS certification changes and incorporate student suggestions, ensuring it remains relevant and valuable. Fair and constructive reviews are essential to improving the course’s quality, and I truly appreciate your honest input. In this field, course ratings above 4.5 are widely regarded as indicators of high-quality content.
Thank you once again for choosing this course and allowing me to be a part of your certification journey!
References:
SAS certification prep guide: base programming by SAS Institute
The little SAS book: a primer / Lora D. Delwiche and Susan J. Slaughter
Learning SAS by example: a programmer's guide / Ron Cody