About this course

Course code TPMAC1
Duration 2 Days

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 macro code are processed.

Prerequisites

Before attending this course, you should have completed the SAS Programming 2: Data Manipulation Techniques 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.

Who should attend?
Experienced SAS programmers who have a sound understanding of DATA step processing and who want to write SAS programs that are reusable and dynamic.

Delegates will learn how to

  • perform text substitution in SAS code
  • automate and customize the production of SAS code
  • conditionally or iteratively construct SAS code
  • use macro variables and macro functions

Outline

Introduction to the Macro Facility

  • course logistics
  • purpose of the macro facility
  • program flow

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 a macro
  • macro parameters
  • macro storage (self-study)

DATA Step and SQL Interfaces

  • creating macro variables in the DATA step
  • indirect references to macro variables
  • retrieving macro variables in the DATA step (self-study)
  • creating macro variables in SQL

Macro Programs

  • conditional processing
  • parameter validation
  • iterative processing
  • global and local symbol tables

Learning More

  • SAS resources
  • other recommended courses

Software Addressed
This course addresses the following software product(s): Base SAS. This course is appropriate for learners who are using SAS 8 or SAS 9 software.

2 Days

Duration

This is a QA approved partner course

Delivery Method

Delivery method

Classroom

Face-to-face learning in the comfort of our quality nationwide centres, with free refreshments and Wi-Fi.

Find dates and prices

Online booking is currently not available for this course, to find out more please call us on 0345 074 7998 or email us at info@qa.com to discuss how we can help.

Trusted, awarded and accredited

Fully accredited to ensure we provide the highest possible standards in learning

All third party trademark rights acknowledged.