<?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: Changing text into date (with special attention to format) in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192761#M4047</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arthur,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created the following Excel file:&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="75"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="75"&gt;date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Current&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20"&gt;12/12/2010&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Current&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20"&gt;03/12/2009&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Current&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I imported it to Excel it gave me the following:&lt;/P&gt;&lt;TABLE cellpadding="5" cellspacing="0" class="table" frame="box" rules="all" summary="Procedure Print: Data Set WORK.CURRENT_CHANGE"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;&lt;TD class="l data"&gt;Current &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;&lt;TD class="l data"&gt;40524 &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;3&lt;/TH&gt;&lt;TD class="l data"&gt;Current &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;4&lt;/TH&gt;&lt;TD class="l data"&gt;40150 &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;5&lt;/TH&gt;&lt;TD class="l data"&gt;Current &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so the "Current" remained the same, but the dates are now numbers, and when I ran the second code it gave me the following:&lt;/P&gt;&lt;TABLE cellpadding="5" cellspacing="0" class="table" frame="box" rules="all" summary="Procedure Print: Data Set WORK.WANT"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;&lt;TD class="r data"&gt;01/12/2013&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;&lt;TD class="r data"&gt;04/05/1924&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;3&lt;/TH&gt;&lt;TD class="r data"&gt;01/12/2013&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;4&lt;/TH&gt;&lt;TD class="r data"&gt;04/01/1950&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;5&lt;/TH&gt;&lt;TD class="r data"&gt;01/12/2013&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;so 12/12/2010 was transformed into 4/5/1924 !!! I guess that Excel and SAS have different date starting points, so how to correct for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Dec 2014 03:48:39 GMT</pubDate>
    <dc:creator>ilikesas</dc:creator>
    <dc:date>2014-12-04T03:48:39Z</dc:date>
    <item>
      <title>Changing text into date (with special attention to format)</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192756#M4042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;I have the following column in a file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="124" style="border: 1px solid rgb(0, 0, 0); width: 131px; height: 114px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;date&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Current&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;12/12/2010&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Current&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3/12/2009&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I would like to have is for "Current" to be transformed into the date 1/12/2013, and for the other dates to, remain the way they are.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This might not be a difficult task but I have a problem with the format because the in Excel file from which I infile my data to SAS this very column is of mixed format and I have problem in SAS because of this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 03:54:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192756#M4042</guid>
      <dc:creator>ilikesas</dc:creator>
      <dc:date>2014-12-03T03:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Changing text into date (with special attention to format)</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192757#M4043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if I correctly understand what you have and want, but it sounds something like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat date $11.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input date &amp;amp;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;Current&lt;/P&gt;&lt;P&gt;12/12/2010&lt;/P&gt;&lt;P&gt;Current&lt;/P&gt;&lt;P&gt;3/12/2009&lt;/P&gt;&lt;P&gt;Not Current&lt;/P&gt;&lt;P&gt;3/12/2009&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want (keep=date);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have (rename=(date=_date));&lt;/P&gt;&lt;P&gt;&amp;nbsp; format date ddmmyy10.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; retain current;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if anyalpha(_date) then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _date eq 'Current' then current=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else current=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; delete;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; else do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if current then date='1dec2013'd;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else date=input(_date,ddmmyy10.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 04:20:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192757#M4043</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-12-03T04:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: Changing text into date (with special attention to format)</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192758#M4044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming your data is character (which it would need to be to contain Current:&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date=tranwrd(date,"Current",put(today90,ddmmyy10.));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 09:25:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192758#M4044</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-12-03T09:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: Changing text into date (with special attention to format)</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192759#M4045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With help of proc format:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data frm;&lt;BR /&gt;FMTNAME='$cnvfmt';&lt;BR /&gt;START='Current';&lt;BR /&gt;LABEL=put(today(),ddmmyy10.);&lt;BR /&gt;type='J';&lt;BR /&gt;output;&lt;BR /&gt;FMTNAME='$cnvfmt';&lt;BR /&gt;START='other';&lt;BR /&gt;LABEL='_same_';&lt;BR /&gt;type='J';&lt;BR /&gt;output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc format cntlin=frm;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;a=input(a,$cnvfmt15.);&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 12:08:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192759#M4045</guid>
      <dc:creator>Loko</dc:creator>
      <dc:date>2014-12-03T12:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Changing text into date (with special attention to format)</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192760#M4046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After seeing the other interpretation of your question, here is another alternative:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data have;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; informat date $11.;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; input date &amp;amp;;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Current&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;12/12/2010&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Current&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;3/12/2009&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Current&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;3/12/2009&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data want (keep=date);&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; set have (rename=(date=_date));&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; format date ddmmyy10.;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 12.7272720336914px; line-height: 1.5em;"&gt;&amp;nbsp; if _date eq 'Current' then &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.7272720336914px; line-height: 1.5em;"&gt;date='1dec2013'd;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; else date=input(_date,ddmmyy10.);&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 12.7272720336914px; line-height: 1.5em;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12.7272720336914px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 12.7272720336914px; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 14:48:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192760#M4046</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-12-03T14:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: Changing text into date (with special attention to format)</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192761#M4047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arthur,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created the following Excel file:&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="75"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="75"&gt;date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Current&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20"&gt;12/12/2010&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Current&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20"&gt;03/12/2009&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;Current&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I imported it to Excel it gave me the following:&lt;/P&gt;&lt;TABLE cellpadding="5" cellspacing="0" class="table" frame="box" rules="all" summary="Procedure Print: Data Set WORK.CURRENT_CHANGE"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;&lt;TD class="l data"&gt;Current &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;&lt;TD class="l data"&gt;40524 &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;3&lt;/TH&gt;&lt;TD class="l data"&gt;Current &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;4&lt;/TH&gt;&lt;TD class="l data"&gt;40150 &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;5&lt;/TH&gt;&lt;TD class="l data"&gt;Current &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so the "Current" remained the same, but the dates are now numbers, and when I ran the second code it gave me the following:&lt;/P&gt;&lt;TABLE cellpadding="5" cellspacing="0" class="table" frame="box" rules="all" summary="Procedure Print: Data Set WORK.WANT"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;&lt;TD class="r data"&gt;01/12/2013&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;&lt;TD class="r data"&gt;04/05/1924&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;3&lt;/TH&gt;&lt;TD class="r data"&gt;01/12/2013&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;4&lt;/TH&gt;&lt;TD class="r data"&gt;04/01/1950&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;5&lt;/TH&gt;&lt;TD class="r data"&gt;01/12/2013&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;so 12/12/2010 was transformed into 4/5/1924 !!! I guess that Excel and SAS have different date starting points, so how to correct for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 03:48:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192761#M4047</guid>
      <dc:creator>ilikesas</dc:creator>
      <dc:date>2014-12-04T03:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Changing text into date (with special attention to format)</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192762#M4048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Loko,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;did your code for my infiled excel and got the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE cellpadding="5" cellspacing="0" class="table" frame="box" rules="all" summary="Procedure Print: Data Set WORK.WANT4"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;&lt;TD class="l data"&gt;Current &lt;/TD&gt;&lt;TD class="r data"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;&lt;TD class="l data"&gt;40524 &lt;/TD&gt;&lt;TD class="r data"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;3&lt;/TH&gt;&lt;TD class="l data"&gt;Current &lt;/TD&gt;&lt;TD class="r data"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;4&lt;/TH&gt;&lt;TD class="l data"&gt;40150 &lt;/TD&gt;&lt;TD class="r data"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;5&lt;/TH&gt;&lt;TD class="l data"&gt;Current &lt;/TD&gt;&lt;TD class="r data"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 03:59:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192762#M4048</guid>
      <dc:creator>ilikesas</dc:creator>
      <dc:date>2014-12-04T03:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Changing text into date (with special attention to format)</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192763#M4049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi RW9,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;did your code and got the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV align="center"&gt;&lt;TABLE cellpadding="5" cellspacing="0" class="table" frame="box" rules="all" summary="Procedure Print: Data Set WORK.WANT3"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;&lt;TD class="r data"&gt;01/12/2013&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;&lt;TD class="r data"&gt;01/12/2013&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;it changed the Curtent into the desired date but omitted the other "good" dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe the problem is with date and I should use a mixed string/number format instead? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 04:02:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192763#M4049</guid>
      <dc:creator>ilikesas</dc:creator>
      <dc:date>2014-12-04T04:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Changing text into date (with special attention to format)</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192764#M4050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're not telling us what you did and you never mentioned anything about what you did in SAS or how you moved data between SAS and Excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The numbers you showed are unformatted Excel dates. If you subtract 21916 from each, and then (in Excel) format them as dates, you'll see that they represent &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.7272720336914px; background-color: #ffffff;"&gt;12/12/2010 and &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.7272720336914px; background-color: #ffffff;"&gt;3/12/2009, respectively.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 04:48:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192764#M4050</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-12-04T04:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: Changing text into date (with special attention to format)</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192765#M4051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arthur and thanks a lot for the late night reply!!! &lt;/P&gt;&lt;P&gt;I tried to go around the formatting by doing the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT= current_change &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATAFILE= "C:\Documents and Settings\HP_Administrator\Desktop\current.xls"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBMS=EXCEL REPLACE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sheet = "Sheet1";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GETNAMES=YES;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MIXED=NO;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SCANTEXT=YES;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; USEDATE=YES;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SCANTIME=YES;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at first the SAS looked just like my Excel, then I did your code with a slight modification:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data current_change2 (drop=_date) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set current_change (rename=(date=_date));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if _date eq 'Current' then date='01/12/2013';&lt;/P&gt;&lt;P&gt;&amp;nbsp; else date=_date;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and this gave me what appeared to be all dates, but when I tried to merge by DATE my table with the new "current-transformed" dates column with a table that contains a column of "pure" dates, that is, only dates and no numbers or words, I get an error message:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'SAS Monospace'; background: yellow;"&gt;ERROR: Expression using equals (=) has components that are of different data types.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess that my new dates aren't in date format, so is there a way to make it a date format?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 05:25:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192765#M4051</guid>
      <dc:creator>ilikesas</dc:creator>
      <dc:date>2014-12-04T05:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: Changing text into date (with special attention to format)</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192766#M4052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again, I just hope that I am not bothering you too much&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that I actually found the way how to change the format, its actually a question by another user on the blog &lt;/P&gt;&lt;P&gt;data current_change3 (drop=date);&lt;/P&gt;&lt;P&gt;set current_change2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;format date2 ddmmyy10.;&lt;/P&gt;&lt;P&gt;date2=input(trim(date),ddmmYY10.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks a lot for everyone!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 06:05:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192766#M4052</guid>
      <dc:creator>ilikesas</dc:creator>
      <dc:date>2014-12-04T06:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: Changing text into date (with special attention to format)</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192767#M4053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I had assumed you had a dataset, there was a typo in my program, see below for proper code. &lt;/P&gt;&lt;P&gt;If you are doing an import then I would highly recommend that you do not use proc import.&amp;nbsp; That is where you problem lies.&amp;nbsp; Excel is not a tool for the transfer of data.&amp;nbsp; It is an unstructured document which will quite happily allow you have test in one cell and dates in another.&amp;nbsp; SAS (like most other data orientated software) operates on a table basis, i.e. all the data in one column fits to one rule.&amp;nbsp; When you proc import SAS trying to guess what you want to do with import data.&amp;nbsp; When it scans the column it gets back some text, and some Excel format dates.&amp;nbsp; If you don't tell it anything else then it will import the lot as text as then all the data can come in.&amp;nbsp; With the options you have put in your import then it will only take date values.&lt;/P&gt;&lt;P&gt;My suggestion would be to&lt;/P&gt;&lt;P&gt;a) use a proper data capture tool which will provide you with structured data which can be logically cleaned etc. &lt;/P&gt;&lt;P&gt;b) write your import programs yourself - you should know what data you want in, how it looks etc. don't let software "guess" for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Updated Code:&lt;/P&gt;&lt;P&gt;data a;&lt;/P&gt;&lt;P&gt;&amp;nbsp; date="Current"; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; date="12/12/2010"; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; date="Current"; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; date="3/12/2009"; output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data b;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set a;&lt;/P&gt;&lt;P&gt;&amp;nbsp; new_date=input(tranwrd(date,"Current",put(today(),ddmmyy10.)),ddmmyy10.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 09:03:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192767#M4053</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-12-04T09:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: Changing text into date (with special attention to format)</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192768#M4054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dates in both SAS and Excel are numbers. In SAS the value is equal to the number of days since Jan 1st, 1960.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Excel the value is equal to the number of days since Dec 31st, 1899, which is why I suggested subtracting 21,916 from each date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The format is simply how the dates are displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally, &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.7272720336914px; background-color: #ffffff;"&gt;'1dec2013'd is known as a date constant in SAS, thus date=&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.63636302948px; line-height: 1.5em;"&gt; &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.7272720336914px; background-color: #ffffff;"&gt;'1dec2013'd produces a number equal to the number of days since Jan 1st, 1960.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 14:16:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Changing-text-into-date-with-special-attention-to-format/m-p/192768#M4054</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-12-04T14:16:13Z</dc:date>
    </item>
  </channel>
</rss>

