<?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: Using Macro Variable in ODS in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-Macro-Variable-in-ODS/m-p/282547#M16278</link>
    <description>&lt;P&gt;Haha.. you're welcome.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ray&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jul 2016 20:13:20 GMT</pubDate>
    <dc:creator>rayIII</dc:creator>
    <dc:date>2016-07-06T20:13:20Z</dc:date>
    <item>
      <title>Using Macro Variable in ODS</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-Macro-Variable-in-ODS/m-p/282540#M16275</link>
      <description>&lt;P&gt;Sorry if this is the wrong place, this is my first post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically I need to make &amp;gt;100 tables using the Output Delivery System. &amp;nbsp;My proc tabulate statement itself works fine on its own, but the ods is&amp;nbsp;&lt;EM&gt;not.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let question=value;&lt;BR /&gt;ods html body = '&amp;amp;question.xls'&lt;BR /&gt;style=minimal;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; here is the proc tabulate that is working fine&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods html close;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, the excel file is successfully being created, but it is literally called &amp;amp;question.xls, when I would want it to be called value.xls so it doesn't continually overwrite itself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If there's a way to throw an array in here and just make one excel file with all &amp;gt;100 tables, that would also be good. &amp;nbsp;I've been using SAS for &amp;nbsp;about a month so sorry if these are totally n00b questions and thank you for reading and for any help you can give me.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 19:55:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-Macro-Variable-in-ODS/m-p/282540#M16275</guid>
      <dc:creator>jfriedman08</dc:creator>
      <dc:date>2016-07-06T19:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using Macro Variable in ODS</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-Macro-Variable-in-ODS/m-p/282542#M16276</link>
      <description>&lt;P&gt;Hi. Just to address the first part of your question, change your first ODS statement to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ods html body = "&amp;amp;question..xls"&amp;nbsp;style=minimal;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 20:08:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-Macro-Variable-in-ODS/m-p/282542#M16276</guid>
      <dc:creator>rayIII</dc:creator>
      <dc:date>2016-07-06T20:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using Macro Variable in ODS</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-Macro-Variable-in-ODS/m-p/282545#M16277</link>
      <description>&lt;P&gt;You are a gangsta of the highest order... thank you!!!!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 20:11:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-Macro-Variable-in-ODS/m-p/282545#M16277</guid>
      <dc:creator>jfriedman08</dc:creator>
      <dc:date>2016-07-06T20:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using Macro Variable in ODS</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-Macro-Variable-in-ODS/m-p/282547#M16278</link>
      <description>&lt;P&gt;Haha.. you're welcome.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ray&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 20:13:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-Macro-Variable-in-ODS/m-p/282547#M16278</guid>
      <dc:creator>rayIII</dc:creator>
      <dc:date>2016-07-06T20:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using Macro Variable in ODS</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-Macro-Variable-in-ODS/m-p/282558#M16279</link>
      <description>&lt;P&gt;Hi, to answer your second question, you do NOT need a DO loop, if BY group processing will work for you. The first example makes one sheet for every BY group. I limited by BY groups to 3 just to keep it simple. The second example puts all 3 tables on 1 worksheet and uses the PAGE dimension instead of BY group processing. But, you have to shift from using ODS HTML to using ODS TAGSETS.EXCELXP, which is an XML-based destination that creates Microsoft Spreadsheet Markup Language XML output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.shoes out=newshoes;
  where region in ('Asia', 'Canada', 'Pacific');
  by region product;
run;
   
** 1: makes one sheet for every BY group;
ods tagsets.excelxp file='c:\temp\showby.xml' style=htmlblue
    options(sheet_interval='bygroup' sheet_name='#byval(region)' doc='Help');
  
proc tabulate data=newshoes;
  class product;
  var sales inventory;
  by region;
  table product all,
        sales='Sales'*(sum mean) inventory='Inventory'*max;
  run;
ods tagsets.excelxp close;
  
** 2: makes one sheet with ALL the tables on that single sheet;
ods tagsets.excelxp file='c:\temp\showsingle.xml' style=htmlblue
    options(sheet_interval='none' sheet_name='All Regions' doc='Help');

proc tabulate data=newshoes;
  class region product;
  var sales inventory;
  table region, 
        product all,
        sales='Sales'*(sum mean) inventory='Inventory'*max /box=_page_;
  run;
ods tagsets.excelxp close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Jul 2016 21:41:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-Macro-Variable-in-ODS/m-p/282558#M16279</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-07-06T21:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using Macro Variable in ODS</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-Macro-Variable-in-ODS/m-p/282604#M16280</link>
      <description>&lt;P&gt;And if you have SAS 9.4 you can look into ODS Excel.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2016 02:40:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-Macro-Variable-in-ODS/m-p/282604#M16280</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-07-07T02:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using Macro Variable in ODS</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-Macro-Variable-in-ODS/m-p/503162#M21883</link>
      <description>&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 17:07:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-Macro-Variable-in-ODS/m-p/503162#M21883</guid>
      <dc:creator>smitham</dc:creator>
      <dc:date>2018-10-10T17:07:18Z</dc:date>
    </item>
  </channel>
</rss>

