<?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: Converting yyyymmdd. to DATE9.? in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Converting-yyyymmdd-to-DATE9/m-p/99573#M1106</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, so you date values are not stored as SAS dates. Then datepart will definitely not work.&lt;/P&gt;&lt;P&gt;So, apart from specifying date9. on the target column, you need to transform the value, as in your initial post.&lt;/P&gt;&lt;P&gt;First, there is not format called yyyymmdd., it's called yymmdd.&lt;/P&gt;&lt;P&gt;In your case, the data is already stored in a read friendly format, so use 8. format in the put statement instead, and yymmdd8. on the input.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Jun 2013 10:01:25 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2013-06-10T10:01:25Z</dc:date>
    <item>
      <title>Converting yyyymmdd. to DATE9.?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Converting-yyyymmdd-to-DATE9/m-p/99569#M1102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working in DI Studio, and have trouble changing the format of a numeric variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My input table has a numeric variable with the format &lt;EM&gt;yyyymmdd&lt;/EM&gt;. Value example: 20130531.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to convert it to the &lt;EM&gt;DATE9&lt;/EM&gt;. format, so that it displays as 31MAY2013.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What kind of expression can I use for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;input(put(DUE_DT, yyyymmdd.),date9.)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, the values only become blank/null.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your time!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jun 2013 14:57:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Converting-yyyymmdd-to-DATE9/m-p/99569#M1102</guid>
      <dc:creator>TurnTheBacon</dc:creator>
      <dc:date>2013-06-07T14:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: Converting yyyymmdd. to DATE9.?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Converting-yyyymmdd-to-DATE9/m-p/99570#M1103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your values are a SAS date value the statement would be: format variablename date9.;&lt;/P&gt;&lt;P&gt;If not then the assignment should be&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;input(put(due_dt,f8.0),yymmdd.);&lt;/P&gt;&lt;P&gt;The put(due_dt, yyyymmdd.) has two problems in your case, first the format would be yymmdd. , second if the value isn't a date value then your results are going to be very unpredictable, and in this case it would represent a day in the future well past the range of dates SAS will manipulate&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jun 2013 15:25:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Converting-yyyymmdd-to-DATE9/m-p/99570#M1103</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-06-07T15:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Converting yyyymmdd. to DATE9.?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Converting-yyyymmdd-to-DATE9/m-p/99571#M1104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What you mean by convert?&lt;/P&gt;&lt;P&gt;Basically,&amp;nbsp; just specify the required format in target table properties. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jun 2013 18:08:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Converting-yyyymmdd-to-DATE9/m-p/99571#M1104</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2013-06-07T18:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: Converting yyyymmdd. to DATE9.?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Converting-yyyymmdd-to-DATE9/m-p/99572#M1105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, but if I simply specify DATE9 as the target table column format, all the values show up as " ********* ". Incompatible date formats, I think.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Incidentally, if I use the expression &lt;STRONG&gt;datepart(due_dt)&lt;/STRONG&gt; and the DATE9 format in the target table, all date values display as "20AUG1960" (correct format, wrong values).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: If I force it to have the 8.0 format, the values still appear as "20130531".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jun 2013 06:39:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Converting-yyyymmdd-to-DATE9/m-p/99572#M1105</guid>
      <dc:creator>TurnTheBacon</dc:creator>
      <dc:date>2013-06-10T06:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: Converting yyyymmdd. to DATE9.?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Converting-yyyymmdd-to-DATE9/m-p/99573#M1106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, so you date values are not stored as SAS dates. Then datepart will definitely not work.&lt;/P&gt;&lt;P&gt;So, apart from specifying date9. on the target column, you need to transform the value, as in your initial post.&lt;/P&gt;&lt;P&gt;First, there is not format called yyyymmdd., it's called yymmdd.&lt;/P&gt;&lt;P&gt;In your case, the data is already stored in a read friendly format, so use 8. format in the put statement instead, and yymmdd8. on the input.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jun 2013 10:01:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Converting-yyyymmdd-to-DATE9/m-p/99573#M1106</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2013-06-10T10:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Converting yyyymmdd. to DATE9.?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Converting-yyyymmdd-to-DATE9/m-p/99574#M1107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Worked like a charm, many thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jun 2013 11:14:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Converting-yyyymmdd-to-DATE9/m-p/99574#M1107</guid>
      <dc:creator>TurnTheBacon</dc:creator>
      <dc:date>2013-06-10T11:14:22Z</dc:date>
    </item>
  </channel>
</rss>

