BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
gaussian
Fluorite | Level 6
Arrays are no technological advancement compared to macros and they have coexisted for several decades now. It is purely a matter of how different techniques fit into data structures you are working with. Macros have several advantages while working with time-series data. I have only presented a watered down version of the data I have and while it may seem like arrays are optimal in this case it doesn't mean you completely understand the data I am working with and are able to dish out advises that are universal in nature.
ballardw
Super User

@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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 16 replies
  • 4008 views
  • 20 likes
  • 7 in conversation