<?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: How to arrange date variable in order after Proc Transpose in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363610#M86125</link>
    <description>&lt;P&gt;DATES as CHARACTER values will only sort correctly when you use yyyymmdd values.&lt;/P&gt;
&lt;P&gt;Consider:&lt;/P&gt;
&lt;PRE&gt;DATA STEP1;
INFILE CARDS MISSOVER;
informat date mmddyy8.;
format date mmddyy8.;
INPUT DATE  UNIT$ AMT IND$;
CARDS;
3/31/15 UNIT1 150 Y
3/31/16 UNIT1 200
4/30/16 UNIT1 300 Y
9/30/16 UNIT1 350 Y
12/31/16 UNIT1 400 Y
3/31/17 UNIT1 450 Y
4/30/17 UNIT1 500 Y
3/31/15 UNIT2 250
3/31/16 UNIT2 200 Y
4/30/16 UNIT2 400 Y
9/30/16 UNIT2 150 Y
12/31/16 UNIT2 200
3/31/17 UNIT2 450 Y
4/30/17 UNIT2 500 Y
3/31/15 UNIT3 550
3/31/16 UNIT3 200
4/30/16 UNIT3 300
9/30/16 UNIT3 350 Y
12/31/16 UNIT3 400 Y
3/31/17 UNIT3 450 Y
4/30/17 UNIT3 500 Y
;
RUN;

proc tabulate data=step1;
  where ind='Y';
  class unit date;
  format date mmddyy8.;
  var amt;
  tables unit='',
         date=''*amt=''*max=''*f=best6.
         /misstext= ' ';
run;
&lt;/PRE&gt;</description>
    <pubDate>Thu, 01 Jun 2017 21:03:52 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-06-01T21:03:52Z</dc:date>
    <item>
      <title>How to arrange date variable in order after Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363577#M86111</link>
      <description>&lt;P&gt;Hi. I have a dataset step1 shown as below. There are seven different time periods for unit1, unit2 and unit3, respectively.&lt;/P&gt;&lt;P&gt;I used Proc Transpose to show dates in columns and units in row. However, in the final table (step2), the dates were not arranged in order - 3/31/16&amp;nbsp;was showing&amp;nbsp;in the last&amp;nbsp;column.&amp;nbsp;I personally suspect it might have something to do with the indicator.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know why and how to fix it?&lt;/P&gt;&lt;P&gt;Thanks for&amp;nbsp;any advices.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&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; STEP1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;INFILE&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;CARDS&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;MISSOVER&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;INPUT&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; DATE$ UNIT$ AMT IND$;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;CARDS&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;3/31/15 UNIT1 150 Y&lt;/P&gt;&lt;P&gt;3/31/16 UNIT1 200&lt;/P&gt;&lt;P&gt;4/30/16 UNIT1 300 Y&lt;/P&gt;&lt;P&gt;9/30/16 UNIT1 350 Y&lt;/P&gt;&lt;P&gt;12/31/16 UNIT1 400 Y&lt;/P&gt;&lt;P&gt;3/31/17 UNIT1 450 Y&lt;/P&gt;&lt;P&gt;4/30/17 UNIT1 500 Y&lt;/P&gt;&lt;P&gt;3/31/15 UNIT2 250&lt;/P&gt;&lt;P&gt;3/31/16 UNIT2 200 Y&lt;/P&gt;&lt;P&gt;4/30/16 UNIT2 400 Y&lt;/P&gt;&lt;P&gt;9/30/16 UNIT2 150 Y&lt;/P&gt;&lt;P&gt;12/31/16 UNIT2 200&lt;/P&gt;&lt;P&gt;3/31/17 UNIT2 450 Y&lt;/P&gt;&lt;P&gt;4/30/17 UNIT2 500 Y&lt;/P&gt;&lt;P&gt;3/31/15 UNIT3 550&lt;/P&gt;&lt;P&gt;3/31/16 UNIT3 200&lt;/P&gt;&lt;P&gt;4/30/16 UNIT3 300&lt;/P&gt;&lt;P&gt;9/30/16 UNIT3 350 Y&lt;/P&gt;&lt;P&gt;12/31/16 UNIT3 400 Y&lt;/P&gt;&lt;P&gt;3/31/17 UNIT3 450 Y&lt;/P&gt;&lt;P&gt;4/30/17 UNIT3 500 Y&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;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;/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;SORT&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;=STEP1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;BY&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; UNIT;&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;/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;TRANSPOSE&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;=STEP1 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;OUT&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=STEP2;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;WHERE&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; IND = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Y'&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;BY&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; UNIT;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ID&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; DATE;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;VAR&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; AMT;&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;PROC&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;PRINT&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;=STEP2;&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;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Obs&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;UNIT&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;_NAME_&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;3/31/2015&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;4/30/2016&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;9/30/2016&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;12/31/2016&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;3/31/2017&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;4/30/2017&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;3/31/2016&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;UNIT1&lt;/TD&gt;&lt;TD&gt;AMT&lt;/TD&gt;&lt;TD&gt;150&lt;/TD&gt;&lt;TD&gt;300&lt;/TD&gt;&lt;TD&gt;350&lt;/TD&gt;&lt;TD&gt;400&lt;/TD&gt;&lt;TD&gt;450&lt;/TD&gt;&lt;TD&gt;500&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;UNIT2&lt;/TD&gt;&lt;TD&gt;AMT&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;TD&gt;400&lt;/TD&gt;&lt;TD&gt;150&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;TD&gt;450&lt;/TD&gt;&lt;TD&gt;500&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;3&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;UNIT3&lt;/TD&gt;&lt;TD&gt;AMT&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;TD&gt;350&lt;/TD&gt;&lt;TD&gt;400&lt;/TD&gt;&lt;TD&gt;450&lt;/TD&gt;&lt;TD&gt;500&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 01 Jun 2017 19:40:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363577#M86111</guid>
      <dc:creator>LL5</dc:creator>
      <dc:date>2017-06-01T19:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to arrange date variable in order after Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363595#M86117</link>
      <description>&lt;P&gt;I would think that you're easiest solution, at this point, would be to add a data step like;&lt;/P&gt;
&lt;PRE&gt;data step2 (drop=_name_);
  retain unit _3_31_15 _3_31_16 _4_30_16 _9_30_16 _12_31_16
                 _3_31_17 _4_30_17;
  set step2;
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 21:55:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363595#M86117</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-06-02T21:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to arrange date variable in order after Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363610#M86125</link>
      <description>&lt;P&gt;DATES as CHARACTER values will only sort correctly when you use yyyymmdd values.&lt;/P&gt;
&lt;P&gt;Consider:&lt;/P&gt;
&lt;PRE&gt;DATA STEP1;
INFILE CARDS MISSOVER;
informat date mmddyy8.;
format date mmddyy8.;
INPUT DATE  UNIT$ AMT IND$;
CARDS;
3/31/15 UNIT1 150 Y
3/31/16 UNIT1 200
4/30/16 UNIT1 300 Y
9/30/16 UNIT1 350 Y
12/31/16 UNIT1 400 Y
3/31/17 UNIT1 450 Y
4/30/17 UNIT1 500 Y
3/31/15 UNIT2 250
3/31/16 UNIT2 200 Y
4/30/16 UNIT2 400 Y
9/30/16 UNIT2 150 Y
12/31/16 UNIT2 200
3/31/17 UNIT2 450 Y
4/30/17 UNIT2 500 Y
3/31/15 UNIT3 550
3/31/16 UNIT3 200
4/30/16 UNIT3 300
9/30/16 UNIT3 350 Y
12/31/16 UNIT3 400 Y
3/31/17 UNIT3 450 Y
4/30/17 UNIT3 500 Y
;
RUN;

proc tabulate data=step1;
  where ind='Y';
  class unit date;
  format date mmddyy8.;
  var amt;
  tables unit='',
         date=''*amt=''*max=''*f=best6.
         /misstext= ' ';
run;
&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Jun 2017 21:03:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363610#M86125</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-01T21:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to arrange date variable in order after Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363617#M86128</link>
      <description>&lt;P&gt;Create an ID with&amp;nbsp;observations with all possible dates, for example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA STEP1;
INFILE CARDS MISSOVER;
INPUT DATE:mmddyy. UNIT$ AMT IND$;
format date mmddyy10.;
CARDS;
3/31/15 UNIT1 150 Y
3/31/16 UNIT1 200
4/30/16 UNIT1 300 Y
9/30/16 UNIT1 350 Y
12/31/16 UNIT1 400 Y
3/31/17 UNIT1 450 Y
4/30/17 UNIT1 500 Y
3/31/15 UNIT2 250
3/31/16 UNIT2 200 Y
4/30/16 UNIT2 400 Y
9/30/16 UNIT2 150 Y
12/31/16 UNIT2 200
3/31/17 UNIT2 450 Y
4/30/17 UNIT2 500 Y
3/31/15 UNIT3 550
3/31/16 UNIT3 200
4/30/16 UNIT3 300
9/30/16 UNIT3 350 Y
12/31/16 UNIT3 400 Y
3/31/17 UNIT3 450 Y
4/30/17 UNIT3 500 Y
;
RUN;
proc sort data=step1;
   by unit;
   run;
proc print;
   run;
proc sort data=step1(keep=date) out=dates nodupkey;
   by date;
   run;
data step2;
   set dates(in=in1) step1;
   if in1 then ind = 'Y';
   run;
proc print;
   run;
proc transpose data=step2 out=step3(where=(not missing(unit))) prefix=D;
   by unit;
   where ind eq 'Y';
   var amt;
   id date;
   run;
proc print;
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;IMG title="2017-06-01_16-30-55.png" alt="2017-06-01_16-30-55.png" src="https://communities.sas.com/t5/image/serverpage/image-id/9190iEC5EA54D82B842B2/image-size/original?v=1.0&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 21:34:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363617#M86128</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2017-06-01T21:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to arrange date variable in order after Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363660#M86152</link>
      <description>Thanks art297, should I run this data step at last? Seems I still have the same result</description>
      <pubDate>Fri, 02 Jun 2017 00:41:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363660#M86152</guid>
      <dc:creator>LL5</dc:creator>
      <dc:date>2017-06-02T00:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to arrange date variable in order after Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363663#M86154</link>
      <description>Thanks data_null_ for this method. I'm trying to understand why Proc transpose has this weird result. Do you have any advices?</description>
      <pubDate>Fri, 02 Jun 2017 00:43:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363663#M86154</guid>
      <dc:creator>LL5</dc:creator>
      <dc:date>2017-06-02T00:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to arrange date variable in order after Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363664#M86155</link>
      <description>&lt;P&gt;Yes! If you run it after ALL of your other steps, and they run without error, by definition it will re-order your variables. If it doesn't, you would have to post your log in order for any of us to identify why it didn't work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 00:46:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363664#M86155</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-06-02T00:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to arrange date variable in order after Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363791#M86189</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/89004"&gt;@LL5&lt;/a&gt; wrote:&lt;BR /&gt;Thanks data_null_ for this method. I'm trying to understand why Proc transpose has this weird result. Do you have any advices?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What weird result are you referring to?&amp;nbsp; PROC TRANSPOSE creates new variables from ID values in the order they are encountered.&amp;nbsp; What else did you expect?&amp;nbsp; My advice is create a dummy ID to establish the order you seek.&amp;nbsp; That is what I posted above.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 13:10:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363791#M86189</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2017-06-02T13:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to arrange date variable in order after Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363818#M86204</link>
      <description>I like your advices and it workd perfectly. but I didn't understand why the my original ID value (dates)was not arranged in order.</description>
      <pubDate>Fri, 02 Jun 2017 14:13:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363818#M86204</guid>
      <dc:creator>LL5</dc:creator>
      <dc:date>2017-06-02T14:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to arrange date variable in order after Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363826#M86208</link>
      <description>Thanks ballarwd. Is the date not arranged/sorted in order due to format? Or because of the missing indicator? Really appreciated for your advices.</description>
      <pubDate>Fri, 02 Jun 2017 14:23:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363826#M86208</guid>
      <dc:creator>LL5</dc:creator>
      <dc:date>2017-06-02T14:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to arrange date variable in order after Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363857#M86214</link>
      <description>&lt;P&gt;When your variable is character then the character sort order is used. Which compares the first character in one value to the first in the second. So 12/16/2017 comes before 3/10/2015 because 1 comes before 3. If your data only represents one year then if you force character date-appearing values to have leading zeroes then 03/ compared to 12/ will sort correctly but with multiple years then you have all the january values together (which may be desireable).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Generally if a value is supposed to be a date, a time or datetime it is worth creating the correct SAS date/ time/ datetime value. Not only do the dates then sort correctly but then they are more useable in graphs (character values don't work for axis very well such as scatter or series) and you can do summaries by time intervals just by changing the format. Consider:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;DATA STEP1;
INFILE CARDS MISSOVER;
informat date mmddyy8.;
format date mmddyy8.;
INPUT DATE  UNIT$ AMT IND$;
CARDS;
3/31/15 UNIT1 150 Y
3/31/16 UNIT1 200
4/30/16 UNIT1 300 Y
9/30/16 UNIT1 350 Y
12/31/16 UNIT1 400 Y
3/31/17 UNIT1 450 Y
4/30/17 UNIT1 500 Y
3/31/15 UNIT2 250
3/31/16 UNIT2 200 Y
4/30/16 UNIT2 400 Y
9/30/16 UNIT2 150 Y
12/31/16 UNIT2 200
3/31/17 UNIT2 450 Y
4/30/17 UNIT2 500 Y
3/31/15 UNIT3 550
3/31/16 UNIT3 200
4/30/16 UNIT3 300
9/30/16 UNIT3 350 Y
12/31/16 UNIT3 400 Y
3/31/17 UNIT3 450 Y
4/30/17 UNIT3 500 Y
;
RUN;

proc tabulate data=step1;
  title 'Annual Sum';
  class date unit;
  format date year4.;
  var amt;
  table unit, date*amt*sum;
run;title;

proc tabulate data=step1;
  title 'Monthly Sum';
  class date unit;
  format date yymon7.;
  var amt;
  table unit, date*amt*sum;
run;title;

proc tabulate data=step1;
  title 'Cross year Monthly Sum';
  class date unit;
  format date monname10.;
  var amt;
  table unit, date*amt*sum;
run;title;&lt;/PRE&gt;
&lt;P&gt;With character values you would have to go through a lot of extra work to pull the character apart and create the correct period of interest and add variables to do it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Coupled with the ability to create custom date formats with Proc Format and the&amp;nbsp;functions to determine intervals between dates or to increment dates (or times or datetimes) the advantages really go to the proper values.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 15:27:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363857#M86214</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-02T15:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to arrange date variable in order after Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363946#M86246</link>
      <description>&lt;P&gt;Hi Art297. Thanks for&amp;nbsp;your&amp;nbsp;method. I run the data step after all the&amp;nbsp;procedures, but seems I got warning in the lob. see below - it says the date variables are uninitialized. Perhaps I should have added a prefix in the Proc Transpose?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 ;*';*";*/;quit;run;&lt;/P&gt;&lt;P&gt;2 OPTIONS PAGENO=MIN;&lt;/P&gt;&lt;P&gt;3 %LET _CLIENTTASKLABEL='Program';&lt;/P&gt;&lt;P&gt;4 %LET _CLIENTPROJECTPATH='';&lt;/P&gt;&lt;P&gt;5 %LET _CLIENTPROJECTNAME='';&lt;/P&gt;&lt;P&gt;6 %LET _SASPROGRAMFILE=;&lt;/P&gt;&lt;P&gt;7&lt;/P&gt;&lt;P&gt;8 ODS _ALL_ CLOSE;&lt;/P&gt;&lt;P&gt;9 OPTIONS DEV=ACTIVEX;&lt;/P&gt;&lt;P&gt;10 GOPTIONS XPIXELS=0 YPIXELS=0;&lt;/P&gt;&lt;P&gt;11 FILENAME EGSR TEMP;&lt;/P&gt;&lt;P&gt;12 ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR&lt;/P&gt;&lt;P&gt;13 STYLE=HtmlBlue&lt;/P&gt;&lt;P&gt;14 STYLESHEET=(URL="file:///C:/Program%20Files%20(x86)/SAS94/x86/SASEnterpriseGuide/7.1/Styles/HtmlBlue.css")&lt;/P&gt;&lt;P&gt;15 NOGTITLE&lt;/P&gt;&lt;P&gt;16 NOGFOOTNOTE&lt;/P&gt;&lt;P&gt;17 GPATH=&amp;amp;sasworklocation&lt;/P&gt;&lt;P&gt;18 ENCODING=UTF8&lt;/P&gt;&lt;P&gt;19 options(rolap="on")&lt;/P&gt;&lt;P&gt;20 ;&lt;/P&gt;&lt;P&gt;NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR&lt;/P&gt;&lt;P&gt;21&lt;/P&gt;&lt;P&gt;22 GOPTIONS ACCESSIBLE;&lt;/P&gt;&lt;P&gt;23&lt;/P&gt;&lt;P&gt;24 data step2 (drop=_:);&lt;/P&gt;&lt;P&gt;25 retain unit _3_31_15 _3_31_16 _4_30_16 _9_30_16 _12_31_16&lt;/P&gt;&lt;P&gt;26 _3_31_17 _4_30_17;&lt;/P&gt;&lt;P&gt;27 set STEP2;&lt;/P&gt;&lt;P&gt;28 run;&lt;/P&gt;&lt;P&gt;NOTE: Variable _3_31_15 is uninitialized.&lt;/P&gt;&lt;P&gt;NOTE: Variable _3_31_16 is uninitialized.&lt;/P&gt;&lt;P&gt;NOTE: Variable _4_30_16 is uninitialized.&lt;/P&gt;&lt;P&gt;NOTE: Variable _9_30_16 is uninitialized.&lt;/P&gt;&lt;P&gt;NOTE: Variable _12_31_16 is uninitialized.&lt;/P&gt;&lt;P&gt;NOTE: Variable _3_31_17 is uninitialized.&lt;/P&gt;&lt;P&gt;NOTE: Variable _4_30_17 is uninitialized.&lt;/P&gt;&lt;P&gt;WARNING: The variable '_:'n in the DROP, KEEP, or RENAME list has never been referenced.&lt;/P&gt;&lt;P&gt;NOTE: There were 3 observations read from the data set WORK.STEP2.&lt;/P&gt;&lt;P&gt;NOTE: The data set WORK.STEP2 has 3 observations and 8 variables.&lt;/P&gt;&lt;P&gt;NOTE: Compressing data set WORK.STEP2 increased size by 100.00 percent.&lt;/P&gt;&lt;P&gt;Compressed is 2 pages; un-compressed would require 1 pages.&lt;/P&gt;&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;/P&gt;&lt;P&gt;real time 0.01 seconds&lt;/P&gt;&lt;P&gt;user cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;system cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;memory 934.37k&lt;/P&gt;&lt;P&gt;OS Memory 20640.00k&lt;/P&gt;&lt;P&gt;Timestamp 06/02/2017 02:42:03 PM&lt;/P&gt;&lt;P&gt;Step Count 9 Switch Count 60&lt;/P&gt;&lt;P&gt;Page Faults 0&lt;/P&gt;&lt;P&gt;Page Reclaims 164&lt;/P&gt;&lt;P&gt;Page Swaps 0&lt;/P&gt;&lt;P&gt;Voluntary Context Switches 188&lt;/P&gt;&lt;P&gt;Involuntary Context Switches 0&lt;/P&gt;&lt;P&gt;Block Input Operations 0&lt;/P&gt;&lt;P&gt;Block Output Operations 272&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2 The SAS System 14:38 Friday, June 2, 2017&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;29&lt;/P&gt;&lt;P&gt;30&lt;/P&gt;&lt;P&gt;31 GOPTIONS NOACCESSIBLE;&lt;/P&gt;&lt;P&gt;32 %LET _CLIENTTASKLABEL=;&lt;/P&gt;&lt;P&gt;33 %LET _CLIENTPROJECTPATH=;&lt;/P&gt;&lt;P&gt;34 %LET _CLIENTPROJECTNAME=;&lt;/P&gt;&lt;P&gt;35 %LET _SASPROGRAMFILE=;&lt;/P&gt;&lt;P&gt;36&lt;/P&gt;&lt;P&gt;37 ;*';*";*/;quit;run;&lt;/P&gt;&lt;P&gt;38 ODS _ALL_ CLOSE;&lt;/P&gt;&lt;P&gt;39&lt;/P&gt;&lt;P&gt;40&lt;/P&gt;&lt;P&gt;41 QUIT; RUN;&lt;/P&gt;&lt;P&gt;42&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 21:47:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363946#M86246</guid>
      <dc:creator>LL5</dc:creator>
      <dc:date>2017-06-02T21:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to arrange date variable in order after Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363947#M86247</link>
      <description>&lt;P&gt;There was an error in the code I posted that I've since corrected. Try the following:&lt;/P&gt;
&lt;PRE&gt;DATA STEP1;
  INFILE CARDS MISSOVER;
  INPUT DATE$ UNIT$ AMT IND$;
  CARDS;
3/31/15 UNIT1 150 Y
3/31/16 UNIT1 200
4/30/16 UNIT1 300 Y
9/30/16 UNIT1 350 Y
12/31/16 UNIT1 400 Y
3/31/17 UNIT1 450 Y
4/30/17 UNIT1 500 Y
3/31/15 UNIT2 250
3/31/16 UNIT2 200 Y
4/30/16 UNIT2 400 Y
9/30/16 UNIT2 150 Y
12/31/16 UNIT2 200
3/31/17 UNIT2 450 Y
4/30/17 UNIT2 500 Y
3/31/15 UNIT3 550
3/31/16 UNIT3 200
4/30/16 UNIT3 300
9/30/16 UNIT3 350 Y
12/31/16 UNIT3 400 Y
3/31/17 UNIT3 450 Y
4/30/17 UNIT3 500 Y
;
RUN;

PROC SORT DATA=STEP1;
  BY UNIT;
RUN;

PROC TRANSPOSE DATA=STEP1 OUT=STEP2;
  WHERE IND = 'Y';
  BY UNIT;
  ID DATE;
  VAR AMT;
RUN;

data step2 (drop=_name_);
  retain unit _3_31_15 _3_31_16 _4_30_16 _9_30_16 _12_31_16
                 _3_31_17 _4_30_17;
  set step2;
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 21:57:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363947#M86247</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-06-02T21:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to arrange date variable in order after Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363952#M86248</link>
      <description>&lt;P&gt;Ballardw,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for your explanations and showing me the examples of using date format in Proc Tabulate to get different result! This apporach is eye opening and&amp;nbsp;these techiques are&amp;nbsp;extremely helpful to me!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And sorry for my stubbornness as I need Proc Transpose instead of Proc Tabulate to achieve my end result, so I applied the date format in my original data step (step 1) and run the Proc Sort and Proc Transpose again, I am still seeing the same result – 03/31/2016 came at last. I wonder why…&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway I could use the Proc Tabulate result or move around the columns from the Proc Transpose result in an excel spreadsheet, but If you can give me additional advices, that’d be great.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt; STEP1;&lt;/P&gt;&lt;P&gt;INFILE CARDS MISSOVER;&lt;/P&gt;&lt;P&gt;INFORMAT DATE mmddyy10.;&lt;/P&gt;&lt;P&gt;FORMAT DATE mmddyy10.;&lt;/P&gt;&lt;P&gt;INPUT DATE UNIT$ AMT IND$;&lt;/P&gt;&lt;P&gt;CARDS;&lt;/P&gt;&lt;P&gt;3/31/15 UNIT1 150 Y&lt;/P&gt;&lt;P&gt;3/31/16 UNIT1 200&lt;/P&gt;&lt;P&gt;4/30/16 UNIT1 300 Y&lt;/P&gt;&lt;P&gt;9/30/16 UNIT1 350 Y&lt;/P&gt;&lt;P&gt;12/31/16 UNIT1 400 Y&lt;/P&gt;&lt;P&gt;3/31/17 UNIT1 450 Y&lt;/P&gt;&lt;P&gt;4/30/17 UNIT1 500 Y&lt;/P&gt;&lt;P&gt;3/31/15 UNIT2 250&lt;/P&gt;&lt;P&gt;3/31/16 UNIT2 200 Y&lt;/P&gt;&lt;P&gt;4/30/16 UNIT2 400 Y&lt;/P&gt;&lt;P&gt;9/30/16 UNIT2 150 Y&lt;/P&gt;&lt;P&gt;12/31/16 UNIT2 200&lt;/P&gt;&lt;P&gt;3/31/17 UNIT2 450 Y&lt;/P&gt;&lt;P&gt;4/30/17 UNIT2 500 Y&lt;/P&gt;&lt;P&gt;3/31/15 UNIT3 550&lt;/P&gt;&lt;P&gt;3/31/16 UNIT3 200&lt;/P&gt;&lt;P&gt;4/30/16 UNIT3 300&lt;/P&gt;&lt;P&gt;9/30/16 UNIT3 350 Y&lt;/P&gt;&lt;P&gt;12/31/16 UNIT3 400 Y&lt;/P&gt;&lt;P&gt;3/31/17 UNIT3 450 Y&lt;/P&gt;&lt;P&gt;4/30/17 UNIT3 500 Y&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt; &lt;STRONG&gt;SORT&lt;/STRONG&gt; DATA=STEP1;&lt;/P&gt;&lt;P&gt;BY UNIT DATE;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt; &lt;STRONG&gt;TRANSPOSE&lt;/STRONG&gt; DATA=STEP1 OUT=STEP2;&lt;/P&gt;&lt;P&gt;WHERE IND = 'Y';&lt;/P&gt;&lt;P&gt;BY UNIT;&lt;/P&gt;&lt;P&gt;ID DATE;&lt;/P&gt;&lt;P&gt;VAR AMT;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt; &lt;STRONG&gt;PRINT&lt;/STRONG&gt; DATA=STEP2;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Obs&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;UNIT&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;_NAME_&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;03/31/2015&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;04/30/2016&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;09/30/2016&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;12/31/2016&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;03/31/2017&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;04/30/2017&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;03/31/2016&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;UNIT1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;AMT&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;150&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;300&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;350&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;400&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;450&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;500&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;UNIT2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;AMT&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;.&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;400&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;150&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;.&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;450&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;500&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;200&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;UNIT3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;AMT&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;.&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;.&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;350&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;400&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;450&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;500&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 22:27:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363952#M86248</guid>
      <dc:creator>LL5</dc:creator>
      <dc:date>2017-06-02T22:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to arrange date variable in order after Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363957#M86250</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 22:49:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/363957#M86250</guid>
      <dc:creator>LL5</dc:creator>
      <dc:date>2017-06-02T22:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to arrange date variable in order after Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/364090#M86310</link>
      <description>&lt;P&gt;PROC TRANSPOSE creates the new variables as it sees values for them. &amp;nbsp;Since you are doing the transpose BY some variable the only way to insure it will create them in the order you want is to make sure the first BY group has ALL of the dates. So please re-read and study the code that&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15410"&gt;@data_null__&lt;/a&gt;&amp;nbsp;posted. &amp;nbsp;That will insure that all of the dates exist in the first group and so that PROC TRANSPOSE will create them in the order you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also if you are going to use dates as text, such as in the names of variables, then ALWAYS use year-month-day order so the character strings will sort in proper date order. &amp;nbsp;Note that this also has the advantage of not confusing your European friends into wondering how you could possible have a date with month number of 31.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jun 2017 05:02:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-arrange-date-variable-in-order-after-Proc-Transpose/m-p/364090#M86310</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-06-04T05:02:06Z</dc:date>
    </item>
  </channel>
</rss>

