<?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: Convert  string to date mmddyy10. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-string-to-date-mmddyy10/m-p/422706#M280907</link>
    <description>&lt;P&gt;You can use the INPUT() function. Your strings look like you should be able to use the MMDDYY informat to read them. Note that dates are numbers so you will need to make a new variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;date = input(string,mmddyy10.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now that you have a date value you can attach any date format to it so that it will print in a human readable form.&amp;nbsp; If you want the date to print in&amp;nbsp;MDY order then attach the MMDDYY10. format to it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format date mmddyy10.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But why not print the numbers using a less confusing date format where users don't have to guess whether the value represents Dec10 or Oct12?&amp;nbsp; Like DATE9. or YYMMDD10.?&lt;/P&gt;</description>
    <pubDate>Wed, 20 Dec 2017 14:59:36 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2017-12-20T14:59:36Z</dc:date>
    <item>
      <title>Convert  string to date mmddyy10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-string-to-date-mmddyy10/m-p/422699#M280905</link>
      <description>&lt;P&gt;Hello, Need help in converting a string value to date datatype in my data set.&lt;/P&gt;&lt;P&gt;Date&amp;nbsp;was stored in string field and now I want to change it to format&amp;nbsp;mmddyy10.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;String values:&amp;nbsp;&lt;/P&gt;&lt;P&gt;12/03/2016&lt;/P&gt;&lt;P&gt;11/29/2016&lt;/P&gt;&lt;P&gt;&amp;nbsp;06/18/2014&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 14:50:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-string-to-date-mmddyy10/m-p/422699#M280905</guid>
      <dc:creator>Melvin_Sas</dc:creator>
      <dc:date>2017-12-20T14:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: Convert  string to date mmddyy10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-string-to-date-mmddyy10/m-p/422704#M280906</link>
      <description>&lt;P&gt;Within a DATA step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;newvar = input(string, mmddyy10.);&lt;/P&gt;
&lt;P&gt;format newvar mmddyy10.;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 14:59:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-string-to-date-mmddyy10/m-p/422704#M280906</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-12-20T14:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Convert  string to date mmddyy10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-string-to-date-mmddyy10/m-p/422706#M280907</link>
      <description>&lt;P&gt;You can use the INPUT() function. Your strings look like you should be able to use the MMDDYY informat to read them. Note that dates are numbers so you will need to make a new variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;date = input(string,mmddyy10.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now that you have a date value you can attach any date format to it so that it will print in a human readable form.&amp;nbsp; If you want the date to print in&amp;nbsp;MDY order then attach the MMDDYY10. format to it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format date mmddyy10.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But why not print the numbers using a less confusing date format where users don't have to guess whether the value represents Dec10 or Oct12?&amp;nbsp; Like DATE9. or YYMMDD10.?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 14:59:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-string-to-date-mmddyy10/m-p/422706#M280907</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-12-20T14:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: Convert  string to date mmddyy10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-string-to-date-mmddyy10/m-p/422707#M280908</link>
      <description>&lt;P&gt;&lt;FONT face="andale mono,times" size="4"&gt;Hi Melvin.&amp;nbsp;&lt;A title="Sample 24591: Convert a character variable that represents a date into a SAS® date" href="http://support.sas.com/kb/24/591.html" target="_self"&gt;This&lt;/A&gt; will answer your question.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 15:00:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-string-to-date-mmddyy10/m-p/422707#M280908</guid>
      <dc:creator>Miracle</dc:creator>
      <dc:date>2017-12-20T15:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Convert  string to date mmddyy10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-string-to-date-mmddyy10/m-p/422708#M280909</link>
      <description>&lt;P&gt;Always better to store date values as number and just to display them in the desired format:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile datalines;
input d $10.;
datalines;
12/03/2016
11/29/2016
06/18/2014
 ;
 run;

data want;
set have;
d_num=input(d,mmddyy10.);

format d_num date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Dec 2017 15:01:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-string-to-date-mmddyy10/m-p/422708#M280909</guid>
      <dc:creator>Loko</dc:creator>
      <dc:date>2017-12-20T15:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: Convert  string to date mmddyy10.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-string-to-date-mmddyy10/m-p/422780#M280910</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
input chardate:$10.;
numdate=input(chardate, mmddyy10.);
format numdate mmddyy10.;
put numdate;
datalines;
12/03/2016
11/29/2016
06/18/2014
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Dec 2017 17:05:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-string-to-date-mmddyy10/m-p/422780#M280910</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-12-20T17:05:40Z</dc:date>
    </item>
  </channel>
</rss>

