<?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 Using a macro field within a proc report to name a tab in excel output in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-a-macro-field-within-a-proc-report-to-name-a-tab-in-excel/m-p/505607#M135420</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying create an excel report where each tab contains several reports where&amp;nbsp;a new tab is created depening on the value within a macro field. The report itself is a macro that is called several times per tab and the call contains the value that names the tab.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is a simplified version of the code:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ods&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; tagsets.excelxp &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;file&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;outpath\&amp;amp;jn - &amp;amp;title Rolling 13 Months &amp;amp;sysdate..xls"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;options(sheet_interval = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"none"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;embedded_titles = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"yes"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;embedded_footnotes = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"yes"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;skip_space = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'0,0,0,0,0'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; all_report(product,characteristic,title3,char_format);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;%macro&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;STRONG&gt;&lt;I&gt;dummy&lt;/I&gt;&lt;/STRONG&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;%mend&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; dummy;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ods&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; tagsets.excelxp options(sheet_interval = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"none"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;sheet_name=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;Product."&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;Proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;report&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=SAS_DATA.rfv_storecards_all_months_&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;product.&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;nowd&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;title1&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;justify&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=left &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;" "&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;title2&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;justify&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=left &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;" "&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;title3&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;justify&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=left &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;title3."&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;Columns&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; customergroup &amp;amp;characteristic._&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;dt_month3_year3.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;characteristic._&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;dt_month2_year2.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;characteristic._&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;dt_month1_year1.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;amp;characteristic._&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;dt_month0_year0.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;Define&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; customergroup / &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;order&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;order&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=internal &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"Customer Group"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;Define&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;characteristic._&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;dt_month3_year3.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; / &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;group&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;dt_month3_year3."&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;style&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(column)={tagattr=&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;char_format.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;};&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;Define&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;characteristic._&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;dt_month2_year2.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; / &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;group&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;dt_month2_year2."&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;style&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(column)={tagattr=&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;char_format.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;};&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;Define&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;characteristic._&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;dt_month1_year1.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; / &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;group&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;dt_month1_year1."&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;style&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(column)={tagattr=&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;char_format.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;};&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;Define&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;characteristic._&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;dt_month0_year0.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; / &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;group&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;dt_month0_year0."&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;style&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(column)={tagattr=&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;char_format.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;};&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;STRONG&gt;&lt;I&gt;all_report&lt;/I&gt;&lt;/STRONG&gt;(retailer1,customer,Customers,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'format:#,##'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;STRONG&gt;&lt;I&gt;all_report&lt;/I&gt;&lt;/STRONG&gt;(retailer1,netsales122,Net Sales,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'format:£#,##0,00'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;STRONG&gt;&lt;I&gt;all_report&lt;/I&gt;&lt;/STRONG&gt;(retailer1,trans122,Transactions,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'format:#,##'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;STRONG&gt;&lt;I&gt;all_report&lt;/I&gt;&lt;/STRONG&gt;(retailer1,ATV,ATV,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'format:£#,##0.00'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;STRONG&gt;&lt;I&gt;all_report&lt;/I&gt;&lt;/STRONG&gt;(retailer1,ASS,ASS,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'format:£#,##0.00'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;STRONG&gt;&lt;I&gt;all_report&lt;/I&gt;&lt;/STRONG&gt;(retailer2,customer,Customers,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'format:#,##'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;STRONG&gt;&lt;I&gt;all_report&lt;/I&gt;&lt;/STRONG&gt;(retailer2,netsales122,Net Sales,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'format:£#,##0,00'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;STRONG&gt;&lt;I&gt;all_report&lt;/I&gt;&lt;/STRONG&gt;(retailer2,trans122,Transactions,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'format:#,##'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;STRONG&gt;&lt;I&gt;all_report&lt;/I&gt;&lt;/STRONG&gt;(retailer2,ATV,ATV,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'format:£#,##0.00'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;STRONG&gt;&lt;I&gt;all_report&lt;/I&gt;&lt;/STRONG&gt;(retailer2,ASS,ASS,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'format:£#,##0.00'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ods&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;_all_&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;close&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want to end up with is a tab called 'retailer1' with 5 reports on it and a second tab called 'retailer2' with 5 reports on it. The variable 'product' in the call&amp;nbsp;statement holds the name for the tab.&amp;nbsp;I have tried several places to put the sheet-Interval and sheet_name options but no joy yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;many thanks&lt;/P&gt;</description>
    <pubDate>Thu, 18 Oct 2018 15:29:44 GMT</pubDate>
    <dc:creator>LouiseH2010</dc:creator>
    <dc:date>2018-10-18T15:29:44Z</dc:date>
    <item>
      <title>Using a macro field within a proc report to name a tab in excel output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-a-macro-field-within-a-proc-report-to-name-a-tab-in-excel/m-p/505607#M135420</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying create an excel report where each tab contains several reports where&amp;nbsp;a new tab is created depening on the value within a macro field. The report itself is a macro that is called several times per tab and the call contains the value that names the tab.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is a simplified version of the code:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ods&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; tagsets.excelxp &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;file&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;outpath\&amp;amp;jn - &amp;amp;title Rolling 13 Months &amp;amp;sysdate..xls"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;options(sheet_interval = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"none"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;embedded_titles = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"yes"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;embedded_footnotes = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"yes"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;skip_space = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'0,0,0,0,0'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; all_report(product,characteristic,title3,char_format);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;%macro&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;STRONG&gt;&lt;I&gt;dummy&lt;/I&gt;&lt;/STRONG&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;%mend&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; dummy;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ods&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; tagsets.excelxp options(sheet_interval = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"none"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;sheet_name=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;Product."&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;Proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;report&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=SAS_DATA.rfv_storecards_all_months_&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;product.&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;nowd&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;title1&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;justify&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=left &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;" "&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;title2&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;justify&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=left &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;" "&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;title3&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;justify&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=left &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;title3."&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;Columns&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; customergroup &amp;amp;characteristic._&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;dt_month3_year3.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;characteristic._&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;dt_month2_year2.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;characteristic._&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;dt_month1_year1.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;amp;characteristic._&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;dt_month0_year0.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;Define&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; customergroup / &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;order&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;order&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=internal &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"Customer Group"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;Define&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;characteristic._&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;dt_month3_year3.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; / &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;group&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;dt_month3_year3."&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;style&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(column)={tagattr=&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;char_format.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;};&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;Define&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;characteristic._&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;dt_month2_year2.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; / &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;group&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;dt_month2_year2."&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;style&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(column)={tagattr=&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;char_format.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;};&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;Define&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;characteristic._&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;dt_month1_year1.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; / &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;group&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;dt_month1_year1."&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;style&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(column)={tagattr=&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;char_format.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;};&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;Define&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;characteristic._&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;dt_month0_year0.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; / &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;group&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;dt_month0_year0."&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;style&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(column)={tagattr=&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;char_format.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;};&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;STRONG&gt;&lt;I&gt;all_report&lt;/I&gt;&lt;/STRONG&gt;(retailer1,customer,Customers,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'format:#,##'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;STRONG&gt;&lt;I&gt;all_report&lt;/I&gt;&lt;/STRONG&gt;(retailer1,netsales122,Net Sales,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'format:£#,##0,00'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;STRONG&gt;&lt;I&gt;all_report&lt;/I&gt;&lt;/STRONG&gt;(retailer1,trans122,Transactions,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'format:#,##'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;STRONG&gt;&lt;I&gt;all_report&lt;/I&gt;&lt;/STRONG&gt;(retailer1,ATV,ATV,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'format:£#,##0.00'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;STRONG&gt;&lt;I&gt;all_report&lt;/I&gt;&lt;/STRONG&gt;(retailer1,ASS,ASS,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'format:£#,##0.00'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;STRONG&gt;&lt;I&gt;all_report&lt;/I&gt;&lt;/STRONG&gt;(retailer2,customer,Customers,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'format:#,##'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;STRONG&gt;&lt;I&gt;all_report&lt;/I&gt;&lt;/STRONG&gt;(retailer2,netsales122,Net Sales,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'format:£#,##0,00'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;STRONG&gt;&lt;I&gt;all_report&lt;/I&gt;&lt;/STRONG&gt;(retailer2,trans122,Transactions,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'format:#,##'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;STRONG&gt;&lt;I&gt;all_report&lt;/I&gt;&lt;/STRONG&gt;(retailer2,ATV,ATV,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'format:£#,##0.00'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;STRONG&gt;&lt;I&gt;all_report&lt;/I&gt;&lt;/STRONG&gt;(retailer2,ASS,ASS,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'format:£#,##0.00'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ods&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;_all_&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;close&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want to end up with is a tab called 'retailer1' with 5 reports on it and a second tab called 'retailer2' with 5 reports on it. The variable 'product' in the call&amp;nbsp;statement holds the name for the tab.&amp;nbsp;I have tried several places to put the sheet-Interval and sheet_name options but no joy yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;many thanks&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 15:29:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-a-macro-field-within-a-proc-report-to-name-a-tab-in-excel/m-p/505607#M135420</guid>
      <dc:creator>LouiseH2010</dc:creator>
      <dc:date>2018-10-18T15:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using a macro field within a proc report to name a tab in excel output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-a-macro-field-within-a-proc-report-to-name-a-tab-in-excel/m-p/505610#M135423</link>
      <description>Try setting sheet_label to blank as well and change the sheet_interval to Now in the macro. &lt;BR /&gt;&lt;BR /&gt;ods tagsets.excelxp options(sheet_interval = "now"&lt;BR /&gt;&lt;BR /&gt;sheet_name="&amp;amp;Product."&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;);&lt;BR /&gt;&lt;BR /&gt;And you really shouldn't nest macro's within each other, that's a recipe for problems.</description>
      <pubDate>Thu, 18 Oct 2018 15:33:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-a-macro-field-within-a-proc-report-to-name-a-tab-in-excel/m-p/505610#M135423</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-18T15:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: Using a macro field within a proc report to name a tab in excel output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-a-macro-field-within-a-proc-report-to-name-a-tab-in-excel/m-p/505876#M135525</link>
      <description>&lt;P&gt;Hiya,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your response - I have tried this in several different places and no luck. I either get 10 tabs with 1 report per tab or 1 tab for the first retailer and all 5 reports and nothing for the second retailer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By nested macro's are you referring to the dummy macro as this is purely to get the colours in the code to be present to make it easier to read.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 09:52:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-a-macro-field-within-a-proc-report-to-name-a-tab-in-excel/m-p/505876#M135525</guid>
      <dc:creator>LouiseH2010</dc:creator>
      <dc:date>2018-10-19T09:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using a macro field within a proc report to name a tab in excel output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-a-macro-field-within-a-proc-report-to-name-a-tab-in-excel/m-p/505957#M135560</link>
      <description>Check your version of the tagsets, it shows up in the log. It should be 1.131 or 2015 - something like that.</description>
      <pubDate>Fri, 19 Oct 2018 14:52:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-a-macro-field-within-a-proc-report-to-name-a-tab-in-excel/m-p/505957#M135560</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-19T14:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using a macro field within a proc report to name a tab in excel output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-a-macro-field-within-a-proc-report-to-name-a-tab-in-excel/m-p/505960#M135562</link>
      <description>&lt;P&gt;It's&amp;nbsp;v1.130&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 14:57:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-a-macro-field-within-a-proc-report-to-name-a-tab-in-excel/m-p/505960#M135562</guid>
      <dc:creator>LouiseH2010</dc:creator>
      <dc:date>2018-10-19T14:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using a macro field within a proc report to name a tab in excel output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-a-macro-field-within-a-proc-report-to-name-a-tab-in-excel/m-p/505962#M135564</link>
      <description>Add another parameter to your macro call, that controls the sheet interval. &lt;BR /&gt;&lt;BR /&gt;When you want to start a new sheet have it called now. At the bottom of the macro reset it back to none so that you always have to specify it at the top of the macro.</description>
      <pubDate>Fri, 19 Oct 2018 14:59:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-a-macro-field-within-a-proc-report-to-name-a-tab-in-excel/m-p/505962#M135564</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-19T14:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using a macro field within a proc report to name a tab in excel output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-a-macro-field-within-a-proc-report-to-name-a-tab-in-excel/m-p/505963#M135565</link>
      <description>&lt;P&gt;It's out of date, update it and try again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/rnd/base/ods/odsmarkup/index.html" target="_blank"&gt;https://support.sas.com/rnd/base/ods/odsmarkup/index.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 15:00:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-a-macro-field-within-a-proc-report-to-name-a-tab-in-excel/m-p/505963#M135565</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-19T15:00:37Z</dc:date>
    </item>
  </channel>
</rss>

