<?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 for missing day in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/date-formats-for-missing-day/m-p/789589#M252680</link>
    <description>yes, that's how I would normally impute dates but this analysis is not requiring date imputation but I still need a numeric value that is equivalent.</description>
    <pubDate>Tue, 11 Jan 2022 21:25:26 GMT</pubDate>
    <dc:creator>HitmonTran</dc:creator>
    <dc:date>2022-01-11T21:25:26Z</dc:date>
    <item>
      <title>date formats for missing day</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-formats-for-missing-day/m-p/789587#M252678</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a date variable (character) and I want to convert it to numeric date value.&amp;nbsp; however, there are some dates missing day and month.&amp;nbsp; Is there a format I can easily use along with input function?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;current in character format&lt;/U&gt;:&lt;/P&gt;&lt;P&gt;2009-10-14&lt;BR /&gt;2010-12-24&lt;BR /&gt;2001-03&lt;BR /&gt;2006-06&lt;BR /&gt;2012&lt;BR /&gt;2002-03-27&lt;BR /&gt;2003-02-03&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I want&amp;nbsp; same values but in numeric date:&lt;/P&gt;&lt;P&gt;2009-10-14&lt;BR /&gt;2010-12-24&lt;BR /&gt;2001-03&amp;nbsp;&lt;BR /&gt;2006-06&amp;nbsp;&lt;BR /&gt;2012&amp;nbsp;&lt;BR /&gt;2002-03-27&lt;BR /&gt;2003-02-03&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 11 Jan 2022 21:16:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-formats-for-missing-day/m-p/789587#M252678</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2022-01-11T21:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: date formats for missing day</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-formats-for-missing-day/m-p/789588#M252679</link>
      <description>&lt;P&gt;The only way I know of that makes sense, is if the day is missing, assign it to 1. If the month is missing, assign it to January. Then all of your records now have a year/month/day, and you can assign a format to them. If necessary, you can also created "flag" variables to indicate if the day was missing or to indicate if the month was missing.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 21:24:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-formats-for-missing-day/m-p/789588#M252679</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-01-11T21:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: date formats for missing day</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-formats-for-missing-day/m-p/789589#M252680</link>
      <description>yes, that's how I would normally impute dates but this analysis is not requiring date imputation but I still need a numeric value that is equivalent.</description>
      <pubDate>Tue, 11 Jan 2022 21:25:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-formats-for-missing-day/m-p/789589#M252680</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2022-01-11T21:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: date formats for missing day</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-formats-for-missing-day/m-p/789590#M252681</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/111564"&gt;@HitmonTran&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;yes, that's how I would normally impute dates but this analysis is not requiring date imputation but I still need a numeric value that is equivalent.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Can you explain further? What are you going to do with this data, where you must work with some calendar information that has no day and some calendar information that has no month?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 21:28:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-formats-for-missing-day/m-p/789590#M252681</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-01-11T21:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: date formats for missing day</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-formats-for-missing-day/m-p/789592#M252683</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;num_date = input(substr(cats(char_date,'-01-01'),1,10),yymmdd10.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Do this after reading your strings into a character variable of length 10.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 21:36:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-formats-for-missing-day/m-p/789592#M252683</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-01-11T21:36:11Z</dc:date>
    </item>
  </channel>
</rss>

