12-20-2016 02:15 AM - edited 12-20-2016 02:16 AM
I want to print all BY groups in single ODS EXCEL sheet. But here each BY group should differentiate with 'Title' on same page.
Example: In sashelp.class, SEX='M' and 'F'. So, both 2 groups should print on the same ODS.excel sheet.
I am using ODS tagsets.excelXP options(sheet_name=);
I am trying to create a macro on this.
12-20-2016 04:06 AM
Your post is confusing. Are you using ODS EXCEL or Tagsets.ExcelXP
How/Where do macros come in?
If tagsets are being used, set sheet_imterval='none' and use PROC REPORT/PRINT to display your data as desired.
12-20-2016 04:41 AM
Why are you trying to create a macro when you don't even seem to know what yuo want to do? This is the number 1 reason why 99% of macros are a total waste of disk space and get deleted as soon as I see them. If your developing code for use across programs, departements, comapnies even, then you should be following the principals of software development lifecycle. Firstly you would create your functional design specification which woud detail purpose, inputs, outputs, testing etc. In this document you would detail requirements, such as whether or not to use ods.excel technology, or ods tagsets technology.
To answer you other question, if you are using tagsets.excelxp then then quick reference sheet really helps:
Look at embedded_titles, and sheet_interval="none" options.
12-22-2016 01:17 AM
I would recommend trying something like this code before you try using macro code. Sheet_interval='none' was designed to do what you describe (putting multiple outputs like BY groups in one sheet).
ods tagsets.excelxp file="c:\temp\bygroup_one_sheet.xml" options(sheet_interval='none'); proc print data=sashelp.class; by age; where age in (12, 13, 14); run; ods tagsets.excelxp close;
12-24-2016 03:28 PM
It seems you posted a similar question in a different forum. I posted an updated version of this program over in that location
But, I am also posting the screen shot here.