DOCUMENTATION
  • Software
    • Software
    • SAS Viya
    • Industries
    • Solutions
    • Products
  • Learn
    • Learn
    • Training
    • Certification
    • Academics
    • Books
    • Video Tutorials
  • Support
    • Support
    • Communities
    • Documentation
    • Developers
    • Support & Services
    • User Groups
  • About Us
    • About Us
    • Why SAS?
    • Company
    • Careers
    • Newsroom
    • Events
    • Contact Us
  • Explore
    • Explore
    • Try & Buy
    • Why SAS?
    • Customer Stories
    • Partners
    • Consulting
  • Software
  • SAS Viya
  • Industries
  • Solutions
  • Products
  • Learn
  • Training
  • Certification
  • Academics
  • Books
  • Video Tutorials
  • Support
  • Communities
  • Documentation
  • Developers
  • Support & Services
  • User Groups
  • About Us
  • Why SAS?
  • Company
  • Careers
  • Newsroom
  • Events
  • Contact Us
  • Explore
  • Try & Buy
  • Why SAS?
  • Customer Stories
  • Partners
  • Consulting
  • Contact Us
Sign In

Create Profile

My SAS

Get access to My SAS, trials, communities and more.

SAS Sites

sas.com
Support
Blogs
Communities
Developer
Curiosity
Videos

Documentation

Learn
Brand
PartnerNet
Merchandise
SAS® Help Center
SAS® 9.4 and SAS® Viya® 3.5 Programming Documentation
SAS 9.4 / Viya 3.5
|PDF 
Feedback
 
  • Welcome to SAS Programming Documentation for SAS® 9.4 and SAS® Viya® 3.5
  • What's New
  • Syntax Quick Links
  • SAS Viya Programming
  • Data Access
  • SAS Analytics 15.4
  • Base SAS Procedures
  • DATA Step Programming
  • SAS Code Debugging
  • Global Statements
  • System Options
  • SAS Component Objects
  • DS2 Programming
  • FedSQL Programming
  • Macro Language Reference
  • Output and Graphics
  • Operating Environments
  • Moving and Accessing SAS Files
  • In-Database Technologies
  • Metadata
  • SAS Interface to Application Response Measurement (ARM)
  • Security
  • SAS Servers
  • SAS Data Quality
  • Learning SAS Programming
  • Accessibility for Base
  • SAS Visual Analytics
  • SAS Studio
  • SAS Enterprise Guide
  • SAS 9.4 Administration
  • SAS Viya: Administration
  • Other Resources
Macro Language Reference
 

SAS® 9.4 Macro Language: Reference, Fifth Edition

Syntax Conventions for the SAS Language
Whatʼs New
Understanding and Using the Macro Facility
Introduction to the Macro Facility
SAS Programs and Macro Processing
Macro Variables
Macro Processing
Scopes of Macro Variables
Macro Expressions
Macro Quoting
Interfaces with the Macro Facility
Storing and Reusing Macros
Macro Facility Error Messages and Debugging
Writing Efficient and Portable Macros
Macro Language Elements
Macro Language Dictionary
AutoCall Macros
Automatic Macro Variables
DATA Step Call Routines for Macros
DATA Step Functions for Macros
Macro Functions
SQL Clauses for Macros
Macro Statements
System Options for Macros
Appendixes
Reserved Words in the Macro Facility
SAS Macro Facility Error and Warning Messages
SAS Tokens
Syntax for Selected Functions Used with the %SYSFUNC Function
SAS Macro Examples
Last updated: September 4, 2026
Privacy Statement Terms of Use 
Copyright © SAS Institute Inc. All Rights Reserved