<?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: Date Formats in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-Formats/m-p/306850#M65664</link>
    <description>&lt;P&gt;Typo, its not needed.&lt;/P&gt;</description>
    <pubDate>Mon, 24 Oct 2016 15:30:10 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2016-10-24T15:30:10Z</dc:date>
    <item>
      <title>Date Formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Formats/m-p/306841#M65659</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 4-Aug-2016 ($20.) , 05-Aug-2016 ($20.)&amp;nbsp;and I want to convert it into a proper date foramt. The following does not work. Could someone suggest a proper method to do it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; want;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; have;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;Date2= input(Date,&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;worddate.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; Date2 &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;date10.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;Thanks&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 15:05:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Formats/m-p/306841#M65659</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2016-10-24T15:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: Date Formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Formats/m-p/306848#M65662</link>
      <description>&lt;P&gt;One example:&lt;/P&gt;
&lt;PRE&gt;data have;
  length dt $20;
  dt="4-Aug-2016"; output;
  dt="05-aug-2016"; output;
run;

data want;
  set have;
  d2=input(compress(dt," -"),date9.);
  format d2 date9.;
run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Oct 2016 15:20:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Formats/m-p/306848#M65662</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-10-24T15:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: Date Formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Formats/m-p/306849#M65663</link>
      <description>Hello,&lt;BR /&gt;Just wondering why is there a space before the hyphen when using compress function?</description>
      <pubDate>Mon, 24 Oct 2016 15:25:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Formats/m-p/306849#M65663</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2016-10-24T15:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Date Formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Formats/m-p/306850#M65664</link>
      <description>&lt;P&gt;Typo, its not needed.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 15:30:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Formats/m-p/306850#M65664</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-10-24T15:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: Date Formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Formats/m-p/306851#M65665</link>
      <description>First I thought the space is used to let SAS to keep anything before that but then I removed the space and still it worked. Just double checking. Thank you again</description>
      <pubDate>Mon, 24 Oct 2016 15:31:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Formats/m-p/306851#M65665</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2016-10-24T15:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Date Formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Formats/m-p/306855#M65667</link>
      <description>&lt;P&gt;The answer is already solved, just wanted to mention, that the date11 informat can read the dates that are shown.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See sample code below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  length dt $20;
  dt="4-Aug-2016"; output;
  dt="05-aug-2016"; output;
run;

data want;
  set have;
  d2 = input(dt, date11.);
  format d2 date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Oct 2016 15:45:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Formats/m-p/306855#M65667</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2016-10-24T15:45:56Z</dc:date>
    </item>
  </channel>
</rss>

