Hi, As Reeza suggests, you cannot append to a TAGSETS.EXCELXP XML file once you have closed it. My rule of thumb when working with macro programs is to start with a working SAS program, so you know what kind of code your macro program has to generate For example, if you had tried to create a 2-tab workbook, you could have done it in one ODS "sandwich" with one procedure step creating output for the first tab, and the second procedure step creating output for the second tab (taking all the defaults). Generally, this means code similar to the code shown below, which creates a multi-sheet workbook. Once you get code like this working for your report, then, and only then, should you look to "macro-ize" your code. It doesn't help to macro-ize non-working code, that is nearly impossible to debug. cynthia ods tagsets.excelxp file='c:\temp\multsheet.xml' options(doc='Help' sheet_name='Starts with J') style=sasweb; proc print data=sashelp.class noobs; where substr(name,1,1) = 'J'; run; ods tagsets.excelxp options(sheet_name='Starts A, B, C'); proc print data=sashelp.class noobs; where substr(name,1,1) in ('A','B','C'); run; ods tagsets.excelxp close;
... View more