@braam:
If your macro code has become too long, your macro has too many parameters, and/or, God forbid, inundated with quoting functions (including those applied to the parameter values to mask what not), you've overstepped the boundaries of the macro language's purpose and utility. Macros are he11 to debug, as one must understand (a) what happens during their compilation, (b) their execution and then (c) what happens during the compilation and (d) execution of the code they have generated.
If you see no alternatives to using macros for SAS code generation (which are plentiful), route your macro-generated code to a text file using the MFILE system option in conjunction with MPRINT. At least then you can run this code stand-alone and see what happens when it executes, rather than guess where in the generated code an array index has run out of bounds because in such a case the only place the SAS log points at is the line where the macro was invoked, so you have no clue.
Kind regards
Paul D.
... View more