<?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: How to read a column having different currency formatted data. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-column-having-different-currency-formatted-data/m-p/478195#M123285</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/221113"&gt;@Nikhiljain22740&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;As far as I know there isn't any SAS provided format to convert currency symbols into currency codes. It shouldn't be that hard though to create one.&lt;/P&gt;
&lt;P&gt;As for currency conversion: There can't be a pre-fabricated format. You'll need a currency conversion table where you lookup conversion rates with some date_key, currency_key type approach.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 15 Jul 2018 11:30:09 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2018-07-15T11:30:09Z</dc:date>
    <item>
      <title>How to read a column having different currency formatted data.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-column-having-different-currency-formatted-data/m-p/478182#M123276</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I've a csv data file that have a salary column. Salary is stored from globally so having dollar, euro, pond... etc symbol. Need help to read such type data into sas.&lt;BR /&gt;&lt;BR /&gt;Example :&lt;BR /&gt;Salary&lt;BR /&gt;$30,000&lt;BR /&gt;€25,000&lt;BR /&gt;€40,000&lt;BR /&gt;¥80,000&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Please help me to read this data in sas.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Nikhil Jain</description>
      <pubDate>Sun, 15 Jul 2018 07:28:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-column-having-different-currency-formatted-data/m-p/478182#M123276</guid>
      <dc:creator>Nikhiljain22740</dc:creator>
      <dc:date>2018-07-15T07:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to read a column having different currency formatted data.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-column-having-different-currency-formatted-data/m-p/478184#M123277</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/221113"&gt;@Nikhiljain22740&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;You can split the source string into the currency symbol and the amount as done in the code below.&lt;/P&gt;
&lt;P&gt;You will need lookup tables for anything else like conversion to 3 letter currency codes or conversion of currency amounts to a baseline currency.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  infile datalines truncover;
  input amount_string $20.;
  currency_amt=input(compress(amount_string,'.','kd'),best32.);
  currency_symbol=substrn(amount_string,1,anydigit(amount_string)-1);
  datalines;
$30,000
€25,000
€40,000
¥80,000
;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jul 2018 07:45:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-column-having-different-currency-formatted-data/m-p/478184#M123277</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-07-15T07:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to read a column having different currency formatted data.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-column-having-different-currency-formatted-data/m-p/478187#M123279</link>
      <description>Thanks Patrick, It'll work but is there any generic solution like any format that we can apply on it.</description>
      <pubDate>Sun, 15 Jul 2018 10:28:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-column-having-different-currency-formatted-data/m-p/478187#M123279</guid>
      <dc:creator>Nikhiljain22740</dc:creator>
      <dc:date>2018-07-15T10:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to read a column having different currency formatted data.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-column-having-different-currency-formatted-data/m-p/478194#M123284</link>
      <description>&lt;P&gt;Patrick,&lt;/P&gt;
&lt;P&gt;You gonna know&amp;nbsp;€25&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;,&lt;/STRONG&gt;&lt;/FONT&gt;000 is expressed as&amp;nbsp; &lt;SPAN&gt;25&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;.&lt;/FONT&gt;&lt;/STRONG&gt;000 not 25000&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jul 2018 11:28:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-column-having-different-currency-formatted-data/m-p/478194#M123284</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-07-15T11:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to read a column having different currency formatted data.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-column-having-different-currency-formatted-data/m-p/478195#M123285</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/221113"&gt;@Nikhiljain22740&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;As far as I know there isn't any SAS provided format to convert currency symbols into currency codes. It shouldn't be that hard though to create one.&lt;/P&gt;
&lt;P&gt;As for currency conversion: There can't be a pre-fabricated format. You'll need a currency conversion table where you lookup conversion rates with some date_key, currency_key type approach.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jul 2018 11:30:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-column-having-different-currency-formatted-data/m-p/478195#M123285</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-07-15T11:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to read a column having different currency formatted data.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-column-having-different-currency-formatted-data/m-p/478196#M123286</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;I've interpreted the comma as thousand separator so the value should become 25000&lt;/P&gt;
&lt;P&gt;In case the comma is the decimal separator then the function reading the amount would need to look like:&lt;/P&gt;
&lt;PRE&gt;  currency_amt=input(compress(amount_string,',','kd'),commax32.);
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;....and I would need to see a string with actual decimals to come up with the final function suitable for the string pattern at hand.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my country of origin the value would be written: 25'000,00&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jul 2018 11:42:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-a-column-having-different-currency-formatted-data/m-p/478196#M123286</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-07-15T11:42:28Z</dc:date>
    </item>
  </channel>
</rss>

