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:
*Yes, there are certain circumstances where a macro is the only way to solve a problem.
Data Step Concepts - content you find here:
http://support.sas.com/documentation/cdl//en/lrcon/69852/HTML/default/viewer.htm#titlepage.htm
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).
To properly make use of by-group-processing, one needs to understand proper data modeling and how to transpose wide data, either by using arrays or proc transpose.
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
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.