I agree with cwilson that your program appears to do what you want. You don't really need to wrap the code in SAS macros, as you could have just included the code in a data step. You also appear to have written scipp_2012_program as a SAS macro. Again, not necessary, but it will still work that way. However, if you are going to keep it as a macro, you have to change the first line and then call the macro. Thus, stealing Carla's suggested code, you could use: %macro scipp_2012_program; DATA test; SET sasuser.test; %A01_CPS_MH run ; proc export data = test outfile ="C:\mySASfolder\myTestScoreResults.xlsx" DBMS=Excel2007 replace ; run ; %MEND scipp_2012_program; %scipp_2012_program
... View more