<?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: Format by Year ODS Excel in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Format-by-Year-ODS-Excel/m-p/576392#M23065</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;BR /&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; have;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; name $ Date1 &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;Date9.&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;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; date1 &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;mmddyy10.&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;datalines&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;Joe 12Dec2018&lt;/P&gt;
&lt;P&gt;Sam 4Jan2018&lt;/P&gt;
&lt;P&gt;Tim 11Jan2018&lt;/P&gt;
&lt;P&gt;Mic 22Dec2018&lt;/P&gt;
&lt;P&gt;Jim 12Jun2019&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;run&lt;/FONT&gt;&lt;/STRONG&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;OPTIONS&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;orientation&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=landscape &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;papersize&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;="letter" &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;missing&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;options&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;nocenter&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ls&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;145&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ps&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;60&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;orientation&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=landscape &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;nomprint&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;nosymbolgen&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;FMTSEARCH&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=(datamart) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;nosource2&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;compress&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=yes &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;reuse&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=yes;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%Let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ReportName = Have_;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%Let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ReportOut = &amp;amp;ReportName.&amp;amp;rptdate;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%LET&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; VERSION = V1;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%Let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; FNote1=Confidential and Proprietary Information.;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%Let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; FNote2=Property of SunTrust For Internal Use Only.;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; REPORTNAME=&amp;amp;ReportName;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; REPORTOUT=&amp;amp;ReportOut;&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;listing&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;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;options&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;missing&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=' ' &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;topmargin&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0.30&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;in &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;bottommargin&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0.01&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;in &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;rightmargin&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0.25&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;in &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;leftmargin&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0.25&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;in;&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="#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;="&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;ReportOut.&lt;STRONG&gt;.x&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;ml" &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;Path&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;="&amp;amp;OutDir" &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;=&amp;amp;dors_style;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;　&lt;/P&gt;
&lt;P&gt;%&lt;STRONG&gt;&lt;I&gt;CoverSheet&lt;/I&gt;&lt;/STRONG&gt;(&amp;amp;ReportName,&amp;amp;pbd_date_key,&amp;amp;Version);&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&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&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;options(Zoom='&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;90&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;' Frozen_Headers='No' Frozen_RowHeaders='No' Autofit_Height = '&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;YES&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;center_horizontal='&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;YES&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;' Embedded_Footnotes='&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;YES&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;' Embedded_Titles="NO"); &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_name = "Have" sheet_interval= 'none');&lt;/FONT&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 face="Courier New" size="3"&gt; = have &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;NOWD&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;split&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;='*' &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;wrap&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; _all_;&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I view the report it formats based on the date in ascending order.&amp;nbsp; However is there something I can do to cause this to order by Year, then month, then date at runtime or display time when its exported?&lt;/P&gt;
&lt;P&gt;Something like this&lt;/P&gt;
&lt;P&gt;2018&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Jan&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; 11&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;etc...........&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I think you need to show a bit more of what you actually expect the output to look like as I can't decipher your example, especially since it doesn't show anything but parts of dates.&lt;/P&gt;
&lt;P&gt;The code you show doesn't run , missing data= on the proc report, so I don't know what you mean by "in date order" . Adding a data= does not make the report run in ascending date order unless you are doing something to the data you do not show or are setting options somewhere not shown such as an ORDER option for one of the variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or are you asking about changing the format of the date variable? If you want something like 2018 Jan 4 then you need a custom format. Maybe as follows and set that as the display format for the date variable. Maybe.&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
picture ymond   
low-high ='%Y%3B%e'  (datatype=date)
;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 25 Jul 2019 15:18:50 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-07-25T15:18:50Z</dc:date>
    <item>
      <title>Format by Year ODS Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Format-by-Year-ODS-Excel/m-p/576389#M23064</link>
      <description>&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; have;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; name $ Date1 &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;Date9.&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;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; date1 &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;mmddyy10.&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;datalines&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;Joe 12Dec2018&lt;/P&gt;
&lt;P&gt;Sam 4Jan2018&lt;/P&gt;
&lt;P&gt;Tim 11Jan2018&lt;/P&gt;
&lt;P&gt;Mic 22Dec2018&lt;/P&gt;
&lt;P&gt;Jim 12Jun2019&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;run&lt;/FONT&gt;&lt;/STRONG&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;OPTIONS&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;orientation&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=landscape &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;papersize&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;="letter" &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;missing&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;options&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;nocenter&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ls&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;145&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ps&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;60&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;orientation&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=landscape &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;nomprint&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;nosymbolgen&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;FMTSEARCH&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=(datamart) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;nosource2&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;compress&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=yes &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;reuse&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=yes;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%Let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ReportName = Have_;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%Let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ReportOut = &amp;amp;ReportName.&amp;amp;rptdate;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%LET&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; VERSION = V1;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%Let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; FNote1=Confidential and Proprietary Information.;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%Let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; FNote2=Property of SunTrust For Internal Use Only.;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; REPORTNAME=&amp;amp;ReportName;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; REPORTOUT=&amp;amp;ReportOut;&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;listing&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;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;options&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;missing&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=' ' &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;topmargin&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0.30&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;in &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;bottommargin&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0.01&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;in &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;rightmargin&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0.25&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;in &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;leftmargin&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0.25&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;in;&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="#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;="&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;ReportOut.&lt;STRONG&gt;.x&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;ml" &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;Path&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;="&amp;amp;OutDir" &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;=&amp;amp;dors_style;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;　&lt;/P&gt;
&lt;P&gt;%&lt;STRONG&gt;&lt;I&gt;CoverSheet&lt;/I&gt;&lt;/STRONG&gt;(&amp;amp;ReportName,&amp;amp;pbd_date_key,&amp;amp;Version);&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&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&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;options(Zoom='&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;90&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;' Frozen_Headers='No' Frozen_RowHeaders='No' Autofit_Height = '&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;YES&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;center_horizontal='&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;YES&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;' Embedded_Footnotes='&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;YES&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;' Embedded_Titles="NO"); &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_name = "Have" sheet_interval= 'none');&lt;/FONT&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 face="Courier New" size="3"&gt; = have &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;NOWD&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;split&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;='*' &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;wrap&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; _all_;&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I view the report it formats based on the date in ascending order.&amp;nbsp; However is there something I can do to cause this to order by Year, then month, then date at runtime or display time when its exported?&lt;/P&gt;
&lt;P&gt;Something like this&lt;/P&gt;
&lt;P&gt;2018&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Jan&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; 11&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;etc...........&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 21:51:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Format-by-Year-ODS-Excel/m-p/576389#M23064</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2019-07-24T21:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: Format by Year ODS Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Format-by-Year-ODS-Excel/m-p/576392#M23065</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;BR /&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; have;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; name $ Date1 &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;Date9.&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;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; date1 &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;mmddyy10.&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;datalines&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;Joe 12Dec2018&lt;/P&gt;
&lt;P&gt;Sam 4Jan2018&lt;/P&gt;
&lt;P&gt;Tim 11Jan2018&lt;/P&gt;
&lt;P&gt;Mic 22Dec2018&lt;/P&gt;
&lt;P&gt;Jim 12Jun2019&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;run&lt;/FONT&gt;&lt;/STRONG&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;OPTIONS&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;orientation&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=landscape &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;papersize&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;="letter" &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;missing&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;options&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;nocenter&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ls&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;145&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ps&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;60&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;orientation&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=landscape &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;nomprint&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;nosymbolgen&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;FMTSEARCH&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=(datamart) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;nosource2&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;compress&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=yes &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;reuse&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=yes;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%Let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ReportName = Have_;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%Let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ReportOut = &amp;amp;ReportName.&amp;amp;rptdate;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%LET&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; VERSION = V1;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%Let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; FNote1=Confidential and Proprietary Information.;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%Let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; FNote2=Property of SunTrust For Internal Use Only.;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; REPORTNAME=&amp;amp;ReportName;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; REPORTOUT=&amp;amp;ReportOut;&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;listing&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;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;options&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;missing&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=' ' &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;topmargin&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0.30&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;in &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;bottommargin&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0.01&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;in &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;rightmargin&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0.25&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;in &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;leftmargin&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0.25&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;in;&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="#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;="&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;ReportOut.&lt;STRONG&gt;.x&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;ml" &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;Path&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;="&amp;amp;OutDir" &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;=&amp;amp;dors_style;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;　&lt;/P&gt;
&lt;P&gt;%&lt;STRONG&gt;&lt;I&gt;CoverSheet&lt;/I&gt;&lt;/STRONG&gt;(&amp;amp;ReportName,&amp;amp;pbd_date_key,&amp;amp;Version);&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&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&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;options(Zoom='&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;90&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;' Frozen_Headers='No' Frozen_RowHeaders='No' Autofit_Height = '&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;YES&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;center_horizontal='&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;YES&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;' Embedded_Footnotes='&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;YES&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;' Embedded_Titles="NO"); &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_name = "Have" sheet_interval= 'none');&lt;/FONT&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 face="Courier New" size="3"&gt; = have &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;NOWD&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;split&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;='*' &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;wrap&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; _all_;&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I view the report it formats based on the date in ascending order.&amp;nbsp; However is there something I can do to cause this to order by Year, then month, then date at runtime or display time when its exported?&lt;/P&gt;
&lt;P&gt;Something like this&lt;/P&gt;
&lt;P&gt;2018&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Jan&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; 11&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;etc...........&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I think you need to show a bit more of what you actually expect the output to look like as I can't decipher your example, especially since it doesn't show anything but parts of dates.&lt;/P&gt;
&lt;P&gt;The code you show doesn't run , missing data= on the proc report, so I don't know what you mean by "in date order" . Adding a data= does not make the report run in ascending date order unless you are doing something to the data you do not show or are setting options somewhere not shown such as an ORDER option for one of the variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or are you asking about changing the format of the date variable? If you want something like 2018 Jan 4 then you need a custom format. Maybe as follows and set that as the display format for the date variable. Maybe.&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
picture ymond   
low-high ='%Y%3B%e'  (datatype=date)
;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2019 15:18:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Format-by-Year-ODS-Excel/m-p/576392#M23065</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-07-25T15:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: Format by Year ODS Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Format-by-Year-ODS-Excel/m-p/576394#M23066</link>
      <description>&lt;P&gt;Not easily, but it can be done. You'd have to add dummy variables to do that and then format them according to how you'd like to view the results. The automatic reporting tools like VA and Tableau have more options for that sort of behaviour.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;EDIT: dummy variables are not dummy coded,ie categorical, instead you'll need duplicates of the date to use. PROC REPORT allows alias so it may be possible just using the one, but I'm not aware of how and would be curious to see if it's possible.&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp;is likely the best for this question.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 22:32:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Format-by-Year-ODS-Excel/m-p/576394#M23066</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-24T22:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: Format by Year ODS Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Format-by-Year-ODS-Excel/m-p/576605#M23075</link>
      <description>&lt;P&gt;Thanks for the vote of confidence, Reeza! I can think of a couple of things. The issue is that without better data or a better understanding of what the output should look like, it's hard to visualize what is needed. There are only 2 variables in the posted data -- hardly enough to need a landscape orientation. It's not clear whether making new variables for year, month and day would be the best approach so there are 3 columns available for ordering or grouping or whether a computed column or alias would work. It really depends on what the ultimate report needs to look like and whether Year, Month and Day need to behave like display items or order/group items.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2019 14:18:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Format-by-Year-ODS-Excel/m-p/576605#M23075</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-07-25T14:18:00Z</dc:date>
    </item>
  </channel>
</rss>

