SAS Macro Language (MACR)
Duration
2 days
Description
This course focuses on the components of the SAS macro facility and how to design, write, and debug macro systems. Emphasis is placed on understanding how programs with and without macro code are processed.
Prerequisite Skills
Before attending this course, you should have completed the SAS Programming II: Manipulating Data with the DATA Step (PROG2) course or have equivalent knowledge. Specifically, you should be able to:
- use a DATA step to read from or write to a SAS data set or external file
- use DATA step programming statements such as IF-THEN/ELSE, DO WHILE, DO UNTIL, and iterative DO
- use SAS data set options such as DROP=, KEEP=, and OBS=
- use character functions such as SUBSTR, SCAN, INDEX, and UPCASE
- form subsets of data using the WHERE clause
- create and use SAS date values and constants
- use SAS procedures such as SORT, PRINT, CONTENTS, MEANS, FREQ, TABULATE, and CHART
Course Topics
Introduction to the Macro Facility
- purpose of the macro facility
- program flow
- course data
Macro Variables
- introduction to macro variables
- automatic macro variables
- macro variable references
- user-defined macro variables
- delimiting macro variable names
- macro functions
Macro Definitions
- defining and calling macros
- macro parameters
DATA Step and SQL Interfaces
- creating macro variables in the DATA step
- indirect references to macro variables
- retrieving macro variables in the DATA step
- creating macro variables in SQL
Macro Programs
- conditional processing
- iterative processing
- global and local symbol tables
Booking
Please contact the Education Team at SAS for the latest information on all SAS courses or to put your name on our specialised course waiting list.



