<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Suppress fields based on dataset in ods output in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Suppress-fields-based-on-dataset-in-ods-output/m-p/844148#M26045</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/5629"&gt;@Q1983&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;In the columns area I list all 4 fields. However I want to just show the two fields that belong to the dataset as I have defined them in ic1 and cc1.&amp;nbsp; The current code would list all 4 in both outputs.&amp;nbsp; Is there a way to accomplish this without separating the individual proc report references.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I'm not really sure what this means, but here is my guess as to what you mean. If this isn't what you want, explain in more detail.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro Report(report,sheet_nm,columns);				
				
ODS TAGSETS.ExcelXP				
   options(sheet_interval='none' absolute_column_width='8' sheet_name="&amp;amp;sheet_nm.");
PROC REPORT DATA=&amp;amp;Report. headskip split='*' wrap nowd ;
    columns &amp;amp;columns;
run;
ODS TAGSETS.ExcelXP close;
%mend Report;				
				
%Report(ic1,IC,Ad_1 Pl_2)
%Report(cc1,CC,H1_1 Pl_2)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note your original code has ODS Tagsets.ExcelXP inside the macro, and ODS TAGSETS.EXCELXP CLOSE; outside the macro. This can't be right, but I don't know which way you want it. In any event, both ODS calls should both be inside the macro or both be outside the macro; and if they are outside the macro you need an additional ODS Tagsets inside the macro to set the sheet name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, why ODS TAGSETS Excel.XP when ODS EXCEL is avialable?&lt;/P&gt;</description>
    <pubDate>Mon, 14 Nov 2022 17:39:29 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-11-14T17:39:29Z</dc:date>
    <item>
      <title>Suppress fields based on dataset in ods output</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Suppress-fields-based-on-dataset-in-ods-output/m-p/844146#M26044</link>
      <description>&lt;PRE&gt;proc sql;
create table ic1 as
select 
		Ad_1,
		Pl_2
from ic
;quit;

proc sql;
create table cc1 as
select 
		H1_1,
		Pl_2
from pc
;quit;

%macro Report(report,sheet_nm);				
				
ODS TAGSETS.ExcelXP				
   options(sheet_interval='none'				
           absolute_column_width='8'				
           sheet_name=&amp;amp;sheet_nm.);
PROC REPORT DATA=&amp;amp;Report. headskip split='*' wrap nowd ;
columns Ad_1 Pl_2 H1_1 Pl_2;
	run;

%mend Report;				
				
%Report(ic1,"IC");	
%Report(cc1,"CC");

ODS TAGSETS.ExcelXP close;
  ods listing;&lt;/PRE&gt;
&lt;P&gt;You cannot run this code however here is the question.&amp;nbsp; In the columns area I list all 4 fields. However I want to just show the two fields that belong to the dataset as I have defined them in ic1 and cc1.&amp;nbsp; The current code would list all 4 in both outputs.&amp;nbsp; Is there a way to accomplish this without separating the individual proc report references.&amp;nbsp; Even though I show only 4 fields my actual project has about 20 fields.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 15:20:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Suppress-fields-based-on-dataset-in-ods-output/m-p/844146#M26044</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2022-11-14T15:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Suppress fields based on dataset in ods output</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Suppress-fields-based-on-dataset-in-ods-output/m-p/844148#M26045</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/5629"&gt;@Q1983&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;In the columns area I list all 4 fields. However I want to just show the two fields that belong to the dataset as I have defined them in ic1 and cc1.&amp;nbsp; The current code would list all 4 in both outputs.&amp;nbsp; Is there a way to accomplish this without separating the individual proc report references.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I'm not really sure what this means, but here is my guess as to what you mean. If this isn't what you want, explain in more detail.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro Report(report,sheet_nm,columns);				
				
ODS TAGSETS.ExcelXP				
   options(sheet_interval='none' absolute_column_width='8' sheet_name="&amp;amp;sheet_nm.");
PROC REPORT DATA=&amp;amp;Report. headskip split='*' wrap nowd ;
    columns &amp;amp;columns;
run;
ODS TAGSETS.ExcelXP close;
%mend Report;				
				
%Report(ic1,IC,Ad_1 Pl_2)
%Report(cc1,CC,H1_1 Pl_2)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note your original code has ODS Tagsets.ExcelXP inside the macro, and ODS TAGSETS.EXCELXP CLOSE; outside the macro. This can't be right, but I don't know which way you want it. In any event, both ODS calls should both be inside the macro or both be outside the macro; and if they are outside the macro you need an additional ODS Tagsets inside the macro to set the sheet name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, why ODS TAGSETS Excel.XP when ODS EXCEL is avialable?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 17:39:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Suppress-fields-based-on-dataset-in-ods-output/m-p/844148#M26045</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-11-14T17:39:29Z</dc:date>
    </item>
  </channel>
</rss>

