<?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: Amount to text conversion in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Amount-to-text-conversion/m-p/503355#M815</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;yes , Amount is a numeric variable&lt;/P&gt;</description>
    <pubDate>Thu, 11 Oct 2018 10:01:11 GMT</pubDate>
    <dc:creator>AshokD</dc:creator>
    <dc:date>2018-10-11T10:01:11Z</dc:date>
    <item>
      <title>Amount to text conversion</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Amount-to-text-conversion/m-p/503341#M810</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on a requirement amount field to text conversion.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My input field Transaction_Amount contains the value&amp;nbsp;&lt;STRONG&gt;£33.17.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have to output the above value to&amp;nbsp;&lt;STRONG&gt;Thirty three pounds and seventeen cents.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Note - Output should be printed to text with the corresponding any input amount value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please someone suggest any format or any other technique to accomplish this ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for the help.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 09:13:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Amount-to-text-conversion/m-p/503341#M810</guid>
      <dc:creator>AshokD</dc:creator>
      <dc:date>2018-10-11T09:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: Amount to text conversion</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Amount-to-text-conversion/m-p/503344#M811</link>
      <description>&lt;P&gt;I assume you meant to put a number into pounds format?&amp;nbsp; There is this post:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/General-SAS-Programming/How-do-I-specify-a-currency-format-and-a-comma-format-in-a-DATA/td-p/80230" target="_blank"&gt;https://communities.sas.com/t5/General-SAS-Programming/How-do-I-specify-a-currency-format-and-a-comma-format-in-a-DATA/td-p/80230&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So the format: nlmnlgbp&lt;/P&gt;
&lt;P&gt;From:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/nlsref/61893/HTML/default/viewer.htm#a003090847.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/nlsref/61893/HTML/default/viewer.htm#a003090847.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 09:19:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Amount-to-text-conversion/m-p/503344#M811</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-10-11T09:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: Amount to text conversion</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Amount-to-text-conversion/m-p/503349#M812</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not trying&amp;nbsp;&lt;SPAN&gt;number into pounds format.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I need to convert pounds into words.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Example :-&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Input&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Output&lt;/STRONG&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;£33.17 – Thirty three pounds and seventeen cents.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;£22.17 -&amp;nbsp; Twenty two&amp;nbsp;pounds and seventeen cents.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 09:37:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Amount-to-text-conversion/m-p/503349#M812</guid>
      <dc:creator>AshokD</dc:creator>
      <dc:date>2018-10-11T09:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: Amount to text conversion</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Amount-to-text-conversion/m-p/503351#M813</link>
      <description>&lt;P&gt;Anotehr good reason for posting test data in the form of a datastep on every question.&amp;nbsp; Avoids the guessing game.&amp;nbsp; There are formats:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000201455.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000201455.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;For instance, me, never had to do it, but I would split up the number into two parts, put them into words per the above, then cat the pounds and pence words with that, something like:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  pounds=input(scan(put(num,best.),1,"."),best.);
  pence=input(scan(put(num.,best.),2,"."),best.);
  want=cat(strip(put(pounds,words10.))," pounds and ",strip(put(pence,words10.))," pence");
run; &lt;/PRE&gt;
&lt;P&gt;Note I cannot test things so you may need to fiddle with it and could be less verbose.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 09:49:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Amount-to-text-conversion/m-p/503351#M813</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-10-11T09:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Amount to text conversion</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Amount-to-text-conversion/m-p/503352#M814</link>
      <description>&lt;P&gt;Just to be clear, is Amount a numeric variable?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 09:49:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Amount-to-text-conversion/m-p/503352#M814</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-10-11T09:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Amount to text conversion</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Amount-to-text-conversion/m-p/503355#M815</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;yes , Amount is a numeric variable&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 10:01:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Amount-to-text-conversion/m-p/503355#M815</guid>
      <dc:creator>AshokD</dc:creator>
      <dc:date>2018-10-11T10:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: Amount to text conversion</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Amount-to-text-conversion/m-p/503367#M816</link>
      <description>&lt;P&gt;Edited&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;s solution a bit, though all credit goes to him.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
num=33.17;output;
num=22.17;output;
run;

data want(drop=pounds pence);
  set have;
  pounds=input(scan(put(num,best.),1,"."),best.);
  pence=input(scan(put(num,best.),2,"."),best.);
  want=cat(strip(put(pounds,words23.))," pounds and ",strip(put(pence,words10.))," pence");
run; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Oct 2018 10:25:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Amount-to-text-conversion/m-p/503367#M816</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-10-11T10:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Amount to text conversion</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Amount-to-text-conversion/m-p/503369#M817</link>
      <description>Thanks for your help and time.</description>
      <pubDate>Thu, 11 Oct 2018 10:29:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Amount-to-text-conversion/m-p/503369#M817</guid>
      <dc:creator>AshokD</dc:creator>
      <dc:date>2018-10-11T10:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: Amount to text conversion</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Amount-to-text-conversion/m-p/503384#M819</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Edited&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;s solution a bit, though all credit goes to him.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
num=33.17;output;
num=22.17;output;
run;

data want(drop=pounds pence);
  set have;
  pounds=input(scan(put(num,best.),1,"."),best.);
  pence=input(scan(put(num,best.),2,"."),best.);
  want=cat(strip(put(pounds,words23.))," pounds and ",strip(put(pence,words10.))," pence");
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I would skip the conversion of value to character etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;29   data _null_;
30      do num=33.17;
31         l = int(num);
32         p = mod(num,l)*1e2;
33         put _all_;
34         end;
35      run;

num=33.17 l=33 p=17 _ERROR_=0 _N_=1
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then format with words.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 12:48:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Amount-to-text-conversion/m-p/503384#M819</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2018-10-11T12:48:34Z</dc:date>
    </item>
  </channel>
</rss>

