<?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 ods excel (header) and macro language in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excel-header-and-macro-language/m-p/796536#M25616</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;How to right align an ISO date in the page header (Excel destination) using print_header= option?&lt;/P&gt;
&lt;P&gt;Note that it works fine with the title statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel file="&amp;amp;xxtest./reporting/ods_excel_test.xlsx";


ods excel options(sheet_name='&amp;amp;R&amp;amp;D'
                  print_header='&amp;amp;R&amp;amp;D');

proc print data=sashelp.class noobs;
run;

ods excel options(sheet_name='%sysfunc'
                  print_header="%sysfunc(today(),e8601da.)");

proc print data=sashelp.class noobs;
run;

*issue;
ods excel options(sheet_name='&amp;amp;R %sysfunc'
                  print_header="&amp;amp;R %sysfunc(today(),e8601da.)");

proc print data=sashelp.class noobs;
run;

*works properly;
ods excel options(sheet_name='Title');

title '&amp;amp;R' "%sysfunc(today(),e8601da.)";

proc print data=sashelp.class noobs;
run;

ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Excel/VBA command: &lt;CODE class=" language-sas"&gt;&amp;amp;D&lt;/CODE&gt; but I don't know how to format it.&lt;/LI&gt;
&lt;LI&gt;&lt;CODE class=" language-sas"&gt;%sysfunc(today(),e8601da.)&lt;/CODE&gt; generated an ISO date but is centered here.&lt;/LI&gt;
&lt;LI&gt;&lt;CODE class=" language-sas"&gt;&amp;amp;R %sysfunc(today(),e8601da.)&lt;/CODE&gt; works but logically enough, the SAS systems tries to solve &amp;amp;R and a message is displayed when opening the Excel file. %nrstr(&amp;amp;R) does not solve the issue here.&lt;/LI&gt;
&lt;LI&gt;OK with the title statement as we can concatenate strings.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance for any tips.&lt;/P&gt;</description>
    <pubDate>Wed, 16 Feb 2022 13:00:13 GMT</pubDate>
    <dc:creator>xxformat_com</dc:creator>
    <dc:date>2022-02-16T13:00:13Z</dc:date>
    <item>
      <title>ods excel (header) and macro language</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excel-header-and-macro-language/m-p/796536#M25616</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;How to right align an ISO date in the page header (Excel destination) using print_header= option?&lt;/P&gt;
&lt;P&gt;Note that it works fine with the title statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel file="&amp;amp;xxtest./reporting/ods_excel_test.xlsx";


ods excel options(sheet_name='&amp;amp;R&amp;amp;D'
                  print_header='&amp;amp;R&amp;amp;D');

proc print data=sashelp.class noobs;
run;

ods excel options(sheet_name='%sysfunc'
                  print_header="%sysfunc(today(),e8601da.)");

proc print data=sashelp.class noobs;
run;

*issue;
ods excel options(sheet_name='&amp;amp;R %sysfunc'
                  print_header="&amp;amp;R %sysfunc(today(),e8601da.)");

proc print data=sashelp.class noobs;
run;

*works properly;
ods excel options(sheet_name='Title');

title '&amp;amp;R' "%sysfunc(today(),e8601da.)";

proc print data=sashelp.class noobs;
run;

ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Excel/VBA command: &lt;CODE class=" language-sas"&gt;&amp;amp;D&lt;/CODE&gt; but I don't know how to format it.&lt;/LI&gt;
&lt;LI&gt;&lt;CODE class=" language-sas"&gt;%sysfunc(today(),e8601da.)&lt;/CODE&gt; generated an ISO date but is centered here.&lt;/LI&gt;
&lt;LI&gt;&lt;CODE class=" language-sas"&gt;&amp;amp;R %sysfunc(today(),e8601da.)&lt;/CODE&gt; works but logically enough, the SAS systems tries to solve &amp;amp;R and a message is displayed when opening the Excel file. %nrstr(&amp;amp;R) does not solve the issue here.&lt;/LI&gt;
&lt;LI&gt;OK with the title statement as we can concatenate strings.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance for any tips.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 13:00:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excel-header-and-macro-language/m-p/796536#M25616</guid>
      <dc:creator>xxformat_com</dc:creator>
      <dc:date>2022-02-16T13:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: ods excel (header) and macro language</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excel-header-and-macro-language/m-p/796539#M25617</link>
      <description>&lt;P&gt;When I use %NRSTR(&amp;amp;R) there are (of course) no messages in the log, and when I open the file in LibreOffice and use the print preview, the date is right-aligned.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 13:20:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excel-header-and-macro-language/m-p/796539#M25617</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-16T13:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: ods excel (header) and macro language</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excel-header-and-macro-language/m-p/796733#M25630</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I run the code I get the following error message when tempting to open the Excel file. Do you see any difference with your code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel file="&amp;amp;xxtest./reporting/ods_excel_test.xlsx";

ods excel options(print_header="%nrstr(&amp;amp;R) %sysfunc(today(),e8601da.)");

proc print data=sashelp.cars (obs=50) noobs;
run;

ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="message1.JPG" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68563i2C0FD93DDCBAA9DE/image-size/large?v=v2&amp;amp;px=999" role="button" title="message1.JPG" alt="message1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 22:45:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excel-header-and-macro-language/m-p/796733#M25630</guid>
      <dc:creator>xxformat_com</dc:creator>
      <dc:date>2022-02-16T22:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: ods excel (header) and macro language</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excel-header-and-macro-language/m-p/796736#M25631</link>
      <description>ps. I'm SAS Studio 3.81 using 9.04.01M5. I've never been able to get the last maintenance even by contacting the SAS support.</description>
      <pubDate>Wed, 16 Feb 2022 22:48:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excel-header-and-macro-language/m-p/796736#M25631</guid>
      <dc:creator>xxformat_com</dc:creator>
      <dc:date>2022-02-16T22:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: ods excel (header) and macro language</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excel-header-and-macro-language/m-p/796738#M25633</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; Your answer helped me realise that the issue could me my SAS installation. I've justed tested it on SAS On-Demand. It works there. So the issue is with my installation somehow. Cheers&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 22:53:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excel-header-and-macro-language/m-p/796738#M25633</guid>
      <dc:creator>xxformat_com</dc:creator>
      <dc:date>2022-02-16T22:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: ods excel (header) and macro language</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excel-header-and-macro-language/m-p/796741#M25634</link>
      <description>&lt;P&gt;SAS On-Demand uses SAS 9.4 M6 I believe, so you'll need to upgrade to at least that in your local SAS installation.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 22:59:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excel-header-and-macro-language/m-p/796741#M25634</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-02-16T22:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: ods excel (header) and macro language</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excel-header-and-macro-language/m-p/796812#M25636</link>
      <description>&lt;P&gt;ODS EXCEL is fairly new (and Excel is always a moving target), so it's no miracle that we repeatedly find (fixed) bugs or inconsistencies. Keeping SAS up-to-date is always a good idea.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 08:47:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excel-header-and-macro-language/m-p/796812#M25636</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-17T08:47:33Z</dc:date>
    </item>
  </channel>
</rss>

