European Currency Conversion

Overview to European Currency Conversion

SAS enables you to convert European currency from one country's currency to an equivalent amount in another country's currency. You can also convert a country's currency to euros, and you can convert euros to a specific country's currency.
SAS provides a group of formats, informats, and a function to use for currency conversion. The set of formats EURFRISO can be used to convert specific European currencies to an amount in euros. ISO represents an ISO standard 4214 currency code. For a complete list of the ISO standard 4217 currency codes, see www.bsi-global.com/Technical%2BInformation/Publications/_Publications/tig90x.doc.

Fixed Rates for Euro Conversion

Twenty-seven European countries comprise the EMU (European Monetary Union). The conversion rates for 17 countries are fixed, and are incorporated into the EURFRISO and EURTOISO formats and into the EUROCURR function. The following table lists the currency codes and conversion rates for the specific currencies whose rates are fixed.
Fixed Rates for Euro Conversion
ISO Currency Code
Conversion Rate
Currency
ATS
13.7603
Austrian schilling
BEF
40.3399
Belgian franc
CYP
0.585274
Cyprus pound
DEM
1.95583
Deutsche mark
ESP
166.386
Spanish peseta
EEK
15.6466
Estonian kroon
EUR
1
Euro
FIM
5.94573
Finnish markka
FRF
6.55957
French franc
GRD
340.750
Greek drachma
IEP
0.787564
Irish pound
ITL
1936.27
Italian lira
LUF
40.3399
Luxembourg franc
MTL
0.429300
Maltese lira
NLG
2.20371
Dutch guilder
PTE
200.482
Portuguese escudo
SIT
239.640
Slovenian tolars
SKK
30.1260
Slovak koruna

Variable Rates for Euro Conversion

For 13 countries in the EMU, currency conversion rates can fluctuate. The conversion rates for these countries are stored in an ASCII text file that you reference with the EURFRTBL fileref. For example you can store the variable rates in a file named variableRates.txt, and reference the file with the Filename EURFRTBL “variables.txt”; statement. The contents of variableRages.txt could be:
EURFRCHF=1.5260
EURFRPLZ=1.3650
You can convert Polish xloty to euros with the following code:
data _null;
x=12345;
put x eurfrplz15.2;
run;
output:
€2.939,29

Example: Converting Between a European Currency and Euros

The following example shows the conversion from Belgian francs to euros. The EURFRBEF format divides the country's currency amount by the exchange rate:
CurrencyAmount / ExchangeRate
12345 / 40.3399 
Example Code: Conversion from Belgian Francs to Euros
data _null_
x=12345 /*convert from Belgian francs to euros*/
put x eurfrbef15.2;
run;
Output:
e306,02
The following example shows the conversion of euros to Belgian francs. The EURTOBEF format multiplies euros by the target currency's exchange rate:
EurosAmount * ExchangeRate
12345 * 40.3399 
data _null_
x=12345; /*convert from euros to Belgian francs*/
put x eurtobef15.2;
run;
Output:
497996.07

Direct Conversion Between European Currencies

The EUROCURR function uses the conversion rate tables to convert between currencies. For conversion between the currencies of two countries,
  1. SAS converts the amount to euros.
    Note: SAS stores the intermediate value as precisely as the operating environment allows, and does not round the value.
  2. SAS converts the amount in euros to an amount in the target currency.
SourceCurrencyAmountEurosAmountTargetCurrencyAmount

BelgianFrancseuros 
12345 / 40.3399 = 306.02456 euros

EurosFrenchFrancs
306.02456 * 6.55957 = 2007.3895 French francs
data _null_;
x=eurocurr(12345,'bef','frf'); /*convert from Belgian francs to French francs*/
put x=;
run;
Output:
x=2007.389499
SAS converts Belgian francs to euros, and then euros to French francs.