<?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 Broken order of month in proc report in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Broken-order-of-month-in-proc-report/m-p/900200#M40115</link>
    <description>&lt;P&gt;I have the following dataset.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
informat Month mmddyy8.;
input ID Group $ Month    ;
Format Month mmddyy8.;
cards;
01 A 12/03/22
02 A 11/03/22 
03 B 12/17/22
04 A 10/17/22 
05 B 09/24/22
06 B 12/24/22
07 C 10/24/22 
08 A 12/31/22
09 A 01/14/23
10 B 02/14/23
11 A 02/21/23
12 A 03/21/23
13 A 04/14/23
14 C 03/14/23 
15 A 01/21/23
16 C 04/21/23
17 A 02/14/23
18 C 01/14/23 
19 B 03/21/23
20 C 01/21/23
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would like to create a report with two columns only. Month and number. Months as Dec2022, Jan2023, Feb2023 etc. The report will have the months in correct order in the month column (not alphabetic order).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried the following but did not work.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=have;
column month n;
define month / group format=monyyyy.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Oct 2023 19:14:00 GMT</pubDate>
    <dc:creator>Barkat</dc:creator>
    <dc:date>2023-10-26T19:14:00Z</dc:date>
    <item>
      <title>Broken order of month in proc report</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Broken-order-of-month-in-proc-report/m-p/900200#M40115</link>
      <description>&lt;P&gt;I have the following dataset.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
informat Month mmddyy8.;
input ID Group $ Month    ;
Format Month mmddyy8.;
cards;
01 A 12/03/22
02 A 11/03/22 
03 B 12/17/22
04 A 10/17/22 
05 B 09/24/22
06 B 12/24/22
07 C 10/24/22 
08 A 12/31/22
09 A 01/14/23
10 B 02/14/23
11 A 02/21/23
12 A 03/21/23
13 A 04/14/23
14 C 03/14/23 
15 A 01/21/23
16 C 04/21/23
17 A 02/14/23
18 C 01/14/23 
19 B 03/21/23
20 C 01/21/23
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would like to create a report with two columns only. Month and number. Months as Dec2022, Jan2023, Feb2023 etc. The report will have the months in correct order in the month column (not alphabetic order).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried the following but did not work.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=have;
column month n;
define month / group format=monyyyy.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 19:14:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Broken-order-of-month-in-proc-report/m-p/900200#M40115</guid>
      <dc:creator>Barkat</dc:creator>
      <dc:date>2023-10-26T19:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: Broken order of month in proc report</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Broken-order-of-month-in-proc-report/m-p/900202#M40116</link>
      <description>&lt;P&gt;The log from your code shows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;6694  proc report data=have;
6695  column month n;
6696  define month / group format=monyyyy.;
&lt;FONT color="#FF0000"&gt;ERROR: The format MONYYYY was not found or could not be loaded.&lt;/FONT&gt;
6697  run;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, you should not get any PROC REPORT output. However, this does not match your subject line ... I suspect you have not shown us the actual code you are using. Please from now on, show us the actual code used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The fix for months out of order, to force PROC REPORT to use the months in order, is&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;define month / group format=monyy. order=internal;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Without ORDER=INTERNAL, SAS puts things in alphabetical order, meaning April is the first month, and usually people don't want that. Using ORDER=INTERNAL, SAS puts things in numerical order, and since month is a numeric variable, SEP22 comes before APR23, the order is what people expect.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 19:23:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Broken-order-of-month-in-proc-report/m-p/900202#M40116</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-10-26T19:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: Broken order of month in proc report</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Broken-order-of-month-in-proc-report/m-p/900205#M40117</link>
      <description>Excellent! Thanks a lot!</description>
      <pubDate>Thu, 26 Oct 2023 19:39:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Broken-order-of-month-in-proc-report/m-p/900205#M40117</guid>
      <dc:creator>Barkat</dc:creator>
      <dc:date>2023-10-26T19:39:12Z</dc:date>
    </item>
  </channel>
</rss>

