<?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: Compute block for type conversion in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Compute-block-for-type-conversion/m-p/537642#M147897</link>
    <description>&lt;P&gt;You cannot put() a datetime number into a date format.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;dummy &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;put&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(datepart(&lt;/SPAN&gt;start_time)&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;date9&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 22 Feb 2019 12:13:14 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2019-02-22T12:13:14Z</dc:date>
    <item>
      <title>Compute block for type conversion</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compute-block-for-type-conversion/m-p/537636#M147892</link>
      <description>&lt;P&gt;Dear SASians,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a new variable in proc report using compute block which should do the type conversion(Numeric to character) but at the end in result I am getting irrelevant symbols(***)&amp;nbsp; as shown below . Please help to sort it out.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data A;
start_time= '11JUN2011:02:45'dt;
run;

proc report data=A out=B;
col start_time dummy;
define start_time/display ;
define dummy/computed;
compute dummy/character length=20;
dummy = put(start_time,date9.);
endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 267px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27348i3F92FE64D42880EA/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2019 11:47:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compute-block-for-type-conversion/m-p/537636#M147892</guid>
      <dc:creator>arunrami</dc:creator>
      <dc:date>2019-02-22T11:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: Compute block for type conversion</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compute-block-for-type-conversion/m-p/537642#M147897</link>
      <description>&lt;P&gt;You cannot put() a datetime number into a date format.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;dummy &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;put&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(datepart(&lt;/SPAN&gt;start_time)&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;date9&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Feb 2019 12:13:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compute-block-for-type-conversion/m-p/537642#M147897</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-02-22T12:13:14Z</dc:date>
    </item>
  </channel>
</rss>

