<?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 issue in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-issue/m-p/60276#M13013</link>
    <description>Here's a small program that works with the sample data and code you provided.  I removed the FORMAT statement for sh_date1 since this variable is dropped.&lt;BR /&gt;
&lt;BR /&gt;
I don't call the STRIP function.  If you see blanks where you expect a valid date, it could be that you're working with a missing value, which might result from an invalid date.&lt;BR /&gt;
&lt;BR /&gt;
[pre]data ship_dates;&lt;BR /&gt;
  length ship_date $ 10;&lt;BR /&gt;
  input ship_date;&lt;BR /&gt;
&lt;BR /&gt;
  sh_date1 = input(ship_date, anydtdte10.);&lt;BR /&gt;
  sh_date2 = put(sh_date1, mmddyy10.);&lt;BR /&gt;
  drop ship_date sh_date1;&lt;BR /&gt;
  rename sh_date2 = ship_date;&lt;BR /&gt;
datalines;&lt;BR /&gt;
9/1/2009&lt;BR /&gt;
10/27/09&lt;BR /&gt;
09/10/2009&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
proc print data=ship_dates; run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Output:&lt;BR /&gt;
[pre]&lt;BR /&gt;
    Obs    ship_date&lt;BR /&gt;
&lt;BR /&gt;
     1     09/01/2009&lt;BR /&gt;
     2     10/27/2009&lt;BR /&gt;
     3     09/10/2009&lt;BR /&gt;
[/pre]</description>
    <pubDate>Fri, 19 Feb 2010 19:33:58 GMT</pubDate>
    <dc:creator>JasonS_SAS</dc:creator>
    <dc:date>2010-02-19T19:33:58Z</dc:date>
    <item>
      <title>Date issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-issue/m-p/60273#M13010</link>
      <description>I have a date field that has the following formats for dates.&lt;BR /&gt;
9/1/2009&lt;BR /&gt;
10/27/09&lt;BR /&gt;
09/10/2009&lt;BR /&gt;
I want to covert them all to mm/dd/yyyy format.&lt;BR /&gt;
I used the followig code:&lt;BR /&gt;
sh_date1=input(ship_date,anydtdte10.);&lt;BR /&gt;
  format sh_date1 mmddyy10.;&lt;BR /&gt;
  sh_date2=put(sh_date1,mmddyy10.);&lt;BR /&gt;
 drop ship_date sh_date1;&lt;BR /&gt;
  rename sh_date2=ship_date;&lt;BR /&gt;
&lt;BR /&gt;
The dates that are in the format 09/10/2009 are shown as blank.&lt;BR /&gt;
How to avoid this?</description>
      <pubDate>Fri, 19 Feb 2010 17:27:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-issue/m-p/60273#M13010</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2010-02-19T17:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: Date issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-issue/m-p/60274#M13011</link>
      <description>Your code worked fine for my test-execution.  Suggest you share your SAS log output and add PUTLOG _ALL_; after all assignments are performed in the last DATA step.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Fri, 19 Feb 2010 17:44:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-issue/m-p/60274#M13011</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-02-19T17:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Date issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-issue/m-p/60275#M13012</link>
      <description>Sbb,&lt;BR /&gt;
it works for me too.only that I have to use strip function.</description>
      <pubDate>Fri, 19 Feb 2010 18:56:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-issue/m-p/60275#M13012</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2010-02-19T18:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: Date issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-issue/m-p/60276#M13013</link>
      <description>Here's a small program that works with the sample data and code you provided.  I removed the FORMAT statement for sh_date1 since this variable is dropped.&lt;BR /&gt;
&lt;BR /&gt;
I don't call the STRIP function.  If you see blanks where you expect a valid date, it could be that you're working with a missing value, which might result from an invalid date.&lt;BR /&gt;
&lt;BR /&gt;
[pre]data ship_dates;&lt;BR /&gt;
  length ship_date $ 10;&lt;BR /&gt;
  input ship_date;&lt;BR /&gt;
&lt;BR /&gt;
  sh_date1 = input(ship_date, anydtdte10.);&lt;BR /&gt;
  sh_date2 = put(sh_date1, mmddyy10.);&lt;BR /&gt;
  drop ship_date sh_date1;&lt;BR /&gt;
  rename sh_date2 = ship_date;&lt;BR /&gt;
datalines;&lt;BR /&gt;
9/1/2009&lt;BR /&gt;
10/27/09&lt;BR /&gt;
09/10/2009&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
proc print data=ship_dates; run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Output:&lt;BR /&gt;
[pre]&lt;BR /&gt;
    Obs    ship_date&lt;BR /&gt;
&lt;BR /&gt;
     1     09/01/2009&lt;BR /&gt;
     2     10/27/2009&lt;BR /&gt;
     3     09/10/2009&lt;BR /&gt;
[/pre]</description>
      <pubDate>Fri, 19 Feb 2010 19:33:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-issue/m-p/60276#M13013</guid>
      <dc:creator>JasonS_SAS</dc:creator>
      <dc:date>2010-02-19T19:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: Date issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-issue/m-p/60277#M13014</link>
      <description>Thanks Jason !</description>
      <pubDate>Fri, 19 Feb 2010 19:41:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-issue/m-p/60277#M13014</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2010-02-19T19:41:43Z</dc:date>
    </item>
  </channel>
</rss>

