Overview This course focuses on using the SAS macro facility to design, write, and debug macro programs, with an emphasis on understanding how programs that contain macro code are processed.
Description
Overview
This course focuses on using the SAS macro facility to design, write, and debug macro programs, with an emphasis on understanding how programs that contain macro code are processed.
Learn how to
•Perform text substitution in SAS code.
•Use macro variables and macro functions.
•Automate and customize the production of SAS code.
•Conditionally or iteratively construct SAS code.
•Write self-modifying, data-driven programs.
Who this class is for?
Experienced SAS programmers who are familiar with simple SQL queries and well-versed in DATA step processing and who want to write reusable, dynamic programs and automate repetitive processing in SAS
Prerequisites
SAS Fundamentals and SAS intermediate courses.
Course Outline
Module 1: Introduction
• Why SAS macro?
• Setting up for this course.
Module 2: SAS Macro Facility
• Program flow.
• Creating and using macro variables.
Module 3: Storing and Processing Text
• Macro functions.
• Using SQL to create macro variables.
• Using the DATA step to create macro variables.
• Indirect references to macro variables.
Module 4: Working with Macro Programs
• Defining and calling a macro.
• Macro variable scope.
• Conditional processing.
• Iterative processing.
Module 5: Developing Macro Applications
• Storing macros.
• Generating data-dependent code.
• Validating parameters and documenting macros.