@gaussian wrote:
I beg to disagree. Macro coding is very common in financial and economic time-series models and data operations. I had worked for several years at a top economic consulting firm and they used extensively macro coding to extend economic variables several months and years into the future. Their legacy SAS code they have dates back to 1-3 decades -- so don't say they don't know what they are doing. Macros are more useful and readable than arrays especially when you have several dozens of time-series indicators you are working with at the same time.
I have solved my problem using arrays for the time being.
Having written SAS code nearly 3 decades ago ( starting Fall of 1986) I can say that there have been many changes in SAS. Just because something works does not mean there is not a better way. In the case of macros, especially complex ones, then it often turns out that replacements that are easier to maintain, understand and sometimes just plain faster are available. Remember the macro runs and generates code that is then executed. If you avoid the macro part the overall execution may be much faster.
You may not quite remember an issue from the late 1990s refered to as Y2k. A major concern was legacy code from mostly major financial institutions that would not handle dates in the year 2000 (or later) correctly.
It is sometimes a good idea to review processes and see if there are better ways.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.