BookmarkSubscribeRSS Feed
Reeza
Super User

There are constantly questions on here about how to convert something to a macro or how to automate something. Many times, the answer is a macro is not required. So, for new users, what would be some things you think a user should understand before they start tackling macro programming?*

 

Two that come to top of my mind are:

 

  • Arrays
  • By Group processing

 

*Yes, there are certain circumstances where a macro is the only way to solve a problem. 

4 REPLIES 4
PGStats
Opal | Level 21

One should be taught, in that order:

 

1 - data _null_ steps for writing code to a file, to be later included
2 - call execute()
3 - the macro facility

 

So that the later would be understood for what it is (i.e. Not a programming language).

PG
noling
SAS Employee

You can't create a macro variable in a datastep then reference it in the same datastep! Order of operations for compilation vs execution time matters!


Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF

View now: on-demand content for SAS users

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1057 views
  • 1 like
  • 5 in conversation