
Develop SAS macro programming for beginners into advanced practice with macro variables and macros. Engage in hands-on assignments, download solutions, and learn prerequisites in base SAS and key procedures.
Install SAS University Edition by downloading VirtualBox and SAS University Edition, then import the appliance, configure shared folders, and launch SAS Studio in your browser.
Connect to SAS Studio via Virtual Box, explore the main window, use Sashelp and Work libraries, manipulate the class data with filters and sorts, and export results.
Discover how SAS macro language automates repetitive tasks with macros and macro variables, enabling dynamic, reusable code for importing files, sorting data, and updating daily report titles.
Learn how to define and use macro variables in SAS with the let statement, reference them with ampersand, and apply them in code and titles.
Explore macro variables, including defining with let, dynamically changing values, printing results with put statements, and computing flexible averages with proc means on the Sashelp.class dataset.
Learn how to create SAS macro variables with the let statement, call symput, call symputx, and proc sql. Compute the average height and the percent taller than average.
learn how to use system-defined automatic macro variables and user-defined macros, display them with put, and master concatenation rules with periods to delimit macro variables in sas.
Explore concatenating macro variables and using double versus single quotes to correctly import files, define path and file name, and resolve macro variables in SAS.
Learn how to indirectly reference macro variables using ampersands, as the macro processor scans left to right, applies re-scan rules, and resolves with two or more ampersands.
Learn to perform indirect macro variable references with two or more macro variables using consecutive ampersands, rescan until the desired reference resolves, and debug with symbolgen.
Explore SAS macro functions across character, evaluation, and quoting tools; apply length, index, substr, eval, sysevalf, and str, nrstr, bquote, nrbquote to manipulate text and mask special characters.
Explore how SAS macros group statements under a name, use a percent sign to invoke them, and use macro variables like dataset-name to print different datasets.
Explore macro parameters by passing values to macros, comparing positional and keyword invocation, and using default values to create flexible, reusable SAS macros for sorting and printing datasets.
Learn to distinguish global and local macro variables in SAS, defined in open code versus inside macros. Understand declaration with let, and protect against name collisions and scope errors.
Learn how to use if-else and if-else-do-end statements in SAS macro programming to control flow with macro variables and compute averages using proc means.
Learn how to build a general SAS macro for ttest analyses, covering one-sample, two-sample, and paired tests, with steps to skeletonize, debug, and parameterize.
Master SAS macro loops, including do, do while, and do until, using a macro index to iterate manufacturers, compute per-manufacturer averages with proc means, and append results into cars_avg.
Master the SYSFUNC macro function to apply nearly any SAS function to macro variables, format dates with worddate, and query datasets using exist, open, and attrn.
Conclude the course by inviting questions and reviews, and promote two follow-up courses—SAS procedures and outlier detection algorithms in data mining and data science—covering statistical analysis, data manipulation, and reporting.
Welcome to the course "SAS Macro Programming - Advanced Programming for Beginners". Macro facility is an important feature of SAS Language. This course will help the novice SAS user bridge the gap between beginner and advanced programmer.
My goal is that at the end of the course, you will not only know and understand Macro Language, but also know to implement it in your programs. Therefore this course includes a lot of assignments. This will allow you to practice and to gain experience. I put a strong emphasis on practice.
All the code programmed during the course can be downloaded. However, i recommend and suggest you to write the code independently, so you can understand it in depth
I divided the course into four sections. First section is Introduction. It includes lectures such as Installation & Familiarity with SAS University Edition and Introduction to SAS Macro. As you will see, SAS Macro consist of two basic elements : macro variables and macros. So in the second section, we will learn macro variables and n the third section we will learn macros. The last section is Conclusions.
If you have any questions about the material, suggestions or ideas how to improve the course, i would be very happy to hear them. Guys, don't hesitate to ask the questions. I will answer any of them.
I sincerely hope you will enjoy the course, and i promise that your programming level will increase significantly!
Your Instructor