<?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: Convert amount present in different Currencies to one currency using Proc Format.!! in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-amount-present-in-different-Currencies-to-one-currency/m-p/251730#M47612</link>
    <description>&lt;P&gt;A quick shot, using a format:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format library=work;
invalue exch
  'INR' = 1.5
  'SGD' = 2.5
  'USD' = 0.8
;
run;

data have;
input curr $ amount;
cards;
INR 100
SGD 200
USD 50
;
run;

data want;
set have;
internal = amount * input(curr,exch.);
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;One might also consider using a hash object to store the exchange rates, but to me the format method is simpler.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Feb 2016 06:59:06 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2016-02-23T06:59:06Z</dc:date>
    <item>
      <title>Convert amount present in different Currencies to one currency using Proc Format.!!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-amount-present-in-different-Currencies-to-one-currency/m-p/251727#M47611</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS Newbee.. I have a file having separate fields for amount and currency e.g.&lt;/P&gt;&lt;P&gt;Amount1 Amount2 Currency&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are 3&amp;nbsp;fixed currencies used inhere i.e. (INR-base, SGD, USD). No other currency type will ever be used. and they have the fixed value for exchange rate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently I was usign the approach, created an exchange rate file (with fields Currency and EXRATE) and then using the currency as key field, multiplied the amount in file1 as per the exchange rate recieved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just wanted to know, if there's some other way round for this. Can we use PROC FORMAT or anyother way to make this happen in PROC SQL&amp;nbsp;i.e. whenever I encounter SGD, multiply the amount field by exrate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2016 06:31:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-amount-present-in-different-Currencies-to-one-currency/m-p/251727#M47611</guid>
      <dc:creator>james_alive</dc:creator>
      <dc:date>2016-02-23T06:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: Convert amount present in different Currencies to one currency using Proc Format.!!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-amount-present-in-different-Currencies-to-one-currency/m-p/251730#M47612</link>
      <description>&lt;P&gt;A quick shot, using a format:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format library=work;
invalue exch
  'INR' = 1.5
  'SGD' = 2.5
  'USD' = 0.8
;
run;

data have;
input curr $ amount;
cards;
INR 100
SGD 200
USD 50
;
run;

data want;
set have;
internal = amount * input(curr,exch.);
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;One might also consider using a hash object to store the exchange rates, but to me the format method is simpler.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2016 06:59:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-amount-present-in-different-Currencies-to-one-currency/m-p/251730#M47612</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-02-23T06:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: Convert amount present in different Currencies to one currency using Proc Format.!!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-amount-present-in-different-Currencies-to-one-currency/m-p/251734#M47615</link>
      <description>perfect. Thanks. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Tue, 23 Feb 2016 08:50:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-amount-present-in-different-Currencies-to-one-currency/m-p/251734#M47615</guid>
      <dc:creator>james_alive</dc:creator>
      <dc:date>2016-02-23T08:50:10Z</dc:date>
    </item>
  </channel>
</rss>

