<?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 Conversion error datetime20.3 to yymmd7. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Conversion-error-datetime20-3-to-yymmd7/m-p/331015#M74341</link>
    <description>&lt;P&gt;I'm trying to convert a datetime20. to a yymmd7. but I'm running into a peculiar error. The data steps run fine, the values get converted... but the error remains.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Code&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input time datetime20.;
format time datetime20.;
informat time datetime20.;
cards;
12SEP2013:10:19:43
;
run;

data want;
set have;
format time datetime20. want_date yymmd7.;
want_date = input(datepart(time),yymmd7.);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Error -- Informat could not be found&amp;nbsp;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;485&lt;BR /&gt;NOTE 485-185: Informat YYMMD was not found or could not be loaded.&lt;/P&gt;&lt;P&gt;28 run;&lt;/P&gt;&lt;P&gt;NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).&lt;BR /&gt;27:19&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Results -- Outputs and runs successfully despite error&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;time want_date&lt;BR /&gt;12Sep2013 10:19:43 2013-09&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Feb 2017 22:35:17 GMT</pubDate>
    <dc:creator>JS</dc:creator>
    <dc:date>2017-02-08T22:35:17Z</dc:date>
    <item>
      <title>Conversion error datetime20.3 to yymmd7.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conversion-error-datetime20-3-to-yymmd7/m-p/331015#M74341</link>
      <description>&lt;P&gt;I'm trying to convert a datetime20. to a yymmd7. but I'm running into a peculiar error. The data steps run fine, the values get converted... but the error remains.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Code&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input time datetime20.;
format time datetime20.;
informat time datetime20.;
cards;
12SEP2013:10:19:43
;
run;

data want;
set have;
format time datetime20. want_date yymmd7.;
want_date = input(datepart(time),yymmd7.);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Error -- Informat could not be found&amp;nbsp;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;485&lt;BR /&gt;NOTE 485-185: Informat YYMMD was not found or could not be loaded.&lt;/P&gt;&lt;P&gt;28 run;&lt;/P&gt;&lt;P&gt;NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).&lt;BR /&gt;27:19&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Results -- Outputs and runs successfully despite error&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;time want_date&lt;BR /&gt;12Sep2013 10:19:43 2013-09&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2017 22:35:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conversion-error-datetime20-3-to-yymmd7/m-p/331015#M74341</guid>
      <dc:creator>JS</dc:creator>
      <dc:date>2017-02-08T22:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion error datetime20.3 to yymmd7.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conversion-error-datetime20-3-to-yymmd7/m-p/331019#M74343</link>
      <description>&lt;P&gt;You're overcomplicating things by a mile, and on the way you cause an unnecessary type conversion.&lt;/P&gt;
&lt;P&gt;Do this instead:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;want_date = datepart(time);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Feb 2017 22:43:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conversion-error-datetime20-3-to-yymmd7/m-p/331019#M74343</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-02-08T22:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion error datetime20.3 to yymmd7.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conversion-error-datetime20-3-to-yymmd7/m-p/331023#M74346</link>
      <description>&lt;P&gt;I see. I was trying to re-input the date unnecssarily. This works beautifully. Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2017 22:55:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conversion-error-datetime20-3-to-yymmd7/m-p/331023#M74346</guid>
      <dc:creator>JS</dc:creator>
      <dc:date>2017-02-08T22:55:00Z</dc:date>
    </item>
  </channel>
</rss>

