<?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 format in proc sql in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/format-in-proc-sql/m-p/401294#M97352</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table A with a column amountA, which is character length 11&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is only one row where in this case amountA = "236761", but it could be "99999.09" (there can be decimals)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to transform it into numeric 20.2&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;So I do something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PROC SQL;
   CREATE TABLE B AS 
   SELECT
            (input(t1.amountA,comma20.2)) FORMAT=20.2 AS Calculation
      FROM A t1;
QUIT;&lt;/PRE&gt;&lt;P&gt;In the output the value is&amp;nbsp;&lt;SPAN&gt;2367.61 =&amp;gt; The amount have been divided by 100...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Whereas I need something like 236761 or 236761.00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Do you know how to manage it?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Oct 2017 11:45:14 GMT</pubDate>
    <dc:creator>FP12</dc:creator>
    <dc:date>2017-10-05T11:45:14Z</dc:date>
    <item>
      <title>format in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-in-proc-sql/m-p/401294#M97352</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table A with a column amountA, which is character length 11&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is only one row where in this case amountA = "236761", but it could be "99999.09" (there can be decimals)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to transform it into numeric 20.2&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;So I do something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PROC SQL;
   CREATE TABLE B AS 
   SELECT
            (input(t1.amountA,comma20.2)) FORMAT=20.2 AS Calculation
      FROM A t1;
QUIT;&lt;/PRE&gt;&lt;P&gt;In the output the value is&amp;nbsp;&lt;SPAN&gt;2367.61 =&amp;gt; The amount have been divided by 100...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Whereas I need something like 236761 or 236761.00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Do you know how to manage it?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 11:45:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-in-proc-sql/m-p/401294#M97352</guid>
      <dc:creator>FP12</dc:creator>
      <dc:date>2017-10-05T11:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: format in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-in-proc-sql/m-p/401299#M97355</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/153928"&gt;@FP12&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you simply use the below statement it should do the trick (I think :))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;(input(t1.amountA,8.)) FORMAT=20.2 AS Calculation&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Damo&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 12:15:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-in-proc-sql/m-p/401299#M97355</guid>
      <dc:creator>Damo</dc:creator>
      <dc:date>2017-10-05T12:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: format in proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-in-proc-sql/m-p/401300#M97356</link>
      <description>&lt;P&gt;Use 8. informat in your INPUT function instead.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 12:22:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-in-proc-sql/m-p/401300#M97356</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-10-05T12:22:40Z</dc:date>
    </item>
  </channel>
</rss>

