If you are going to use a data step to generate the macro variables then why to you need all of the macro %IF statements? Why not just do that within the data step using normal IF statements? Normal SAS code is much easier to debug than macro code. Or alternatively if all you are doing in the CALL SYMPUT is concatenating macro variable values then why do you need the CALL SYMPUT() functions at all? For example consider the first CALL SYMPUT() function call. call symput("startdt", "'01-JAN-"||strip(&yearinteger.)||"'") ; That is the same as %let STARTDT=%sysfunc(dequote("'01-JAN-&yearinteger'")) ; Also why are you setting the macro variable YEARINTEGER to have the code to call the SUM() function? Why not just set it to have the number that would result if you actually did the addition? Replace %let yearinteger = sum(&yearinteger., 1) ; with %let yearinteger = %eval(&yearinteger + 1) ;
... View more