SAS programming part 3: macro essentials

This course is designed for experienced SAS users and for those who have already taken the SAS fundamentals course and who want to study in detail some SAS programming aspects. The SAS Macro language allows you to build reusable SAS programme modules. These topics will be discussed:

  • the position of the 'Macro facility' in the SAS environment;
  • the basic elements of the Macro language;
  • the integration of Macro structures in the 'SAS Base' programming language;
  • how to add the Macro logic to the 'step' reasoning of the SAS compiler.

At the end of this course, participants will have extended their SAS programming skills considerably.


No public sessions are currently scheduled. We will be pleased to set up an on-site course or to schedule an extra public session (in case of a sufficient number of candidates). Interested? Please let us know.

Intended for

Analysts, programmers, people responsible for support as well as experienced SAS users. This course is designed for both PC and mainframe users. Although "SAS on mainframe" is used in the labs, "SAS on Windows" is available for those delegates that never work in a mainframe terminal session. The statements and commands, as well as the context discussed are the same on all platforms.


Participants should have followed the course SAS programming part 1: fundamentals or should have equivalent experience. Some practical SAS programming experience is a must.

Main topics

  • macro concept - principles, macro compiler, programme flow library structures
  • conditional and standard execution of macros
  • debugging, autocall and macro library structures
  • 'quoting' techniques for the use of special characters
  • macro integration in the classic SAS programmes (Data Step - Proc Step)
  • indirect variable references (Proc Step)
  • implementation of macros in order to extend the SAS language (functions, statements)
  • SAS Macro programming:
  • calculations
  • integration of functions and routines
  • manipulation of variables, local and global
  • conditional and iterative programme logic
  • debugging/troubleshooting

Training method

Classroom training with demonstrations and exercises.


1 day.

Course leader

Sandy Schillebeeckx.