<?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 Date Help in ODS Excel Title in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-Help-in-ODS-Excel-Title/m-p/827994#M327067</link>
    <description>&lt;P&gt;I have searched all kinds of website for the answers and none of the examples I am finding work.&lt;/P&gt;&lt;P&gt;I hope someone has the answer....&lt;/P&gt;&lt;P&gt;I assign a date at the beginning of my program&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;%let FromDate=01JUN2022;&lt;BR /&gt;%let ToDate=31JUL2022;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I reference it all throughout the program with no issues.&lt;/P&gt;&lt;P&gt;When it comes time to produce the excel output though it only comes out in sas date format, I need it in mmddyy10. format&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BobbyG0627_0-1660081359679.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/74321i6FDA3A47424B399D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BobbyG0627_0-1660081359679.png" alt="BobbyG0627_0-1660081359679.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;this is the code sample that produced the above...&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;&lt;BR /&gt;ODS EXCEL FILE="&amp;amp;flname." OPTIONS(SHEET_NAME="My Sheet" EMBEDDED_TITLES="YES" FROZEN_HEADERS="3" AUTOFILTER="ALL" );
RUN;
TITLE j=l "My Report";
TITLE2 j=l "&amp;amp;FromDate - &amp;amp;ToDate.";;
RUN;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Aug 2022 21:46:56 GMT</pubDate>
    <dc:creator>BobbyG0627</dc:creator>
    <dc:date>2022-08-09T21:46:56Z</dc:date>
    <item>
      <title>Date Help in ODS Excel Title</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Help-in-ODS-Excel-Title/m-p/827994#M327067</link>
      <description>&lt;P&gt;I have searched all kinds of website for the answers and none of the examples I am finding work.&lt;/P&gt;&lt;P&gt;I hope someone has the answer....&lt;/P&gt;&lt;P&gt;I assign a date at the beginning of my program&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;%let FromDate=01JUN2022;&lt;BR /&gt;%let ToDate=31JUL2022;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I reference it all throughout the program with no issues.&lt;/P&gt;&lt;P&gt;When it comes time to produce the excel output though it only comes out in sas date format, I need it in mmddyy10. format&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BobbyG0627_0-1660081359679.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/74321i6FDA3A47424B399D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BobbyG0627_0-1660081359679.png" alt="BobbyG0627_0-1660081359679.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;this is the code sample that produced the above...&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;&lt;BR /&gt;ODS EXCEL FILE="&amp;amp;flname." OPTIONS(SHEET_NAME="My Sheet" EMBEDDED_TITLES="YES" FROZEN_HEADERS="3" AUTOFILTER="ALL" );
RUN;
TITLE j=l "My Report";
TITLE2 j=l "&amp;amp;FromDate - &amp;amp;ToDate.";;
RUN;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 21:46:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Help-in-ODS-Excel-Title/m-p/827994#M327067</guid>
      <dc:creator>BobbyG0627</dc:creator>
      <dc:date>2022-08-09T21:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: Date Help in ODS Excel Title</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Help-in-ODS-Excel-Title/m-p/827995#M327068</link>
      <description>&lt;P&gt;Macro variables, such as you create, are TEXT. As such the only "format" that applies is the $ format for literal text.&lt;/P&gt;
&lt;P&gt;You would need to create a second macro variable for use in the Title.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you don't want to manually create the other value here is one way using what your have entered&lt;/P&gt;
&lt;PRE&gt;%let FromDate=01JUN2022;

%let Titlefrom = %sysfunc(putn("&amp;amp;fromdate."d,mmddyy10.));

&lt;/PRE&gt;
&lt;P&gt;You could place all of that %sysfunc code directly into the Title2 statement but it can make harder to read code. Plus if you end up wanting that value somewhere else you would have the same code in multiple places.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 21:55:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Help-in-ODS-Excel-Title/m-p/827995#M327068</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-08-09T21:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: Date Help in ODS Excel Title</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Help-in-ODS-Excel-Title/m-p/827997#M327069</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;TITLE2 j=l "%sysfunc(inputn(&amp;amp;FromDate, date9.), mmddyy10.) - %sysfunc(inputn(&amp;amp;ToDate, date9.), mmddyy10.)";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here's a great, but longer and in depth, reference for dates and times in SAS&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Working-with-Dates-and-Times-in-SAS-Tutorial/ta-p/424354" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Working-with-Dates-and-Times-in-SAS-Tutorial/ta-p/424354&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/413831"&gt;@BobbyG0627&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have searched all kinds of website for the answers and none of the examples I am finding work.&lt;/P&gt;
&lt;P&gt;I hope someone has the answer....&lt;/P&gt;
&lt;P&gt;I assign a date at the beginning of my program&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;%let FromDate=01JUN2022;&lt;BR /&gt;%let ToDate=31JUL2022;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I reference it all throughout the program with no issues.&lt;/P&gt;
&lt;P&gt;When it comes time to produce the excel output though it only comes out in sas date format, I need it in mmddyy10. format&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BobbyG0627_0-1660081359679.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/74321i6FDA3A47424B399D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BobbyG0627_0-1660081359679.png" alt="BobbyG0627_0-1660081359679.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;this is the code sample that produced the above...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;&lt;BR /&gt;ODS EXCEL FILE="&amp;amp;flname." OPTIONS(SHEET_NAME="My Sheet" EMBEDDED_TITLES="YES" FROZEN_HEADERS="3" AUTOFILTER="ALL" );
RUN;
TITLE j=l "My Report";
TITLE2 j=l "&amp;amp;FromDate - &amp;amp;ToDate.";;
RUN;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 21:59:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Help-in-ODS-Excel-Title/m-p/827997#M327069</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-08-09T21:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: Date Help in ODS Excel Title</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Help-in-ODS-Excel-Title/m-p/827998#M327070</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let FromDate=01JUN2022;
%let ToDate=31JUL2022;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;These are not in MMDDYY10. appearance. You have to change the appearance of this macro variable value in order to get MMDDYY10.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
    call symputx('fromdate1',put("&amp;amp;fromdate"D,mmddyy10.));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and then later use &amp;amp;FROMDATE1 in TITLE2. Of course, you would perform the same conversion on &amp;amp;TODATE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 22:35:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Help-in-ODS-Excel-Title/m-p/827998#M327070</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-08-09T22:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Date Help in ODS Excel Title</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Help-in-ODS-Excel-Title/m-p/828064#M327105</link>
      <description>&lt;P&gt;Thank you!!! this was exactly what i needed, I have several outputs so this was exactly what i needed&lt;/P&gt;&lt;P&gt;thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 11:32:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Help-in-ODS-Excel-Title/m-p/828064#M327105</guid>
      <dc:creator>BobbyG0627</dc:creator>
      <dc:date>2022-08-10T11:32:57Z</dc:date>
    </item>
  </channel>
</rss>

