Yes, first thing to remember is that SAS Macro is not like functions in other languages. Macro language is a text generation software, i.e. it generates code, nothing else. It is useful to avoid repeating code where only certain bits change. It does this by passing macro logic to the pre-processor once, call execute is simlar. As this only happens once, its not generally a good idea to be call execute generating data from inside a macro.
As I posted there is generally better ways of doing this. If you can provide some test data and what you want the output to look like I can provide code, but the way it is now its messy and difficult to debug.
... View more