I have several macros that use AREAD. But, I tried something this weekend that I still have not figured out. Maybe someone has a suggestion.

I also use macros as a way to include large blocks of common code in programs. I tried to create such a macro from some code that used one of my macros that used AREAD. I found that the use of AREAD in the lower-level macro actually read from the 'top level' program source, not from the source in the 'next-up' macro.

The doc does indicated that this would happen:
"...from the records in the primary input
stream that follow immediately after the macro instruction."

So, it looks like the only way to use an AREAD and read from an 'higher level' macro, would be to have the higher level macro push the info to be read into the buffer using AINSERT. Not as 'nice'.

Did I miss some other option?

(Before you suggest COPY vs. macros for common code, I usually include parms to the common code. I can re-work that logic using .SETC, etc., but that has some negative issues I would need to think about before doing so.)



Tony Thigpen

Reply via email to