1. If a macro-based program is used to generate SAS code, write and debug the desired SAS program without any macro coding. Make sure the SAS program runs with hard-coded programming constants on a fixed set of data.
2.Generalize the program by removing hard-coded programming constants and substituting macro variable references. Initialize the macro variables with %LET statements and try different values for the macro variables. Use the SYMBOLGEN system option to assist in debugging or confirmation. You may need to adjust the basic program to make it more generalized.
3.Create a macro definition by inserting %MACRO and %MEND statements around your program. Convert %LET statements to macro parameters, if desired. Call the macro using different parameter values. Use the MPRINT and SYMBOLGEN system options for debugging.