Page 1 of 1

creating a routine for excahnge of foriegn currency

Posted: Wed Aug 09, 2006 1:43 am
by adamgo
I am about to write a new routine for exchange of foreign currency.
the routine will accept these 4 inputs :
the date , the currency code, the desired currency code and the sum.
the output will be the exchanged sum.

all the data is stored in a hash file.

my question is so :
a. did any one write a similar routine ?
b. will the hash file be opened and scanned for each time it shall be called or will the DS upload the hash file to the memory the first time and after that it will just scan for the output each time ?

my main concern is that the performance will not be damaged by running this routine.

help will be appreciated
thank you
A.

Posted: Wed Aug 09, 2006 2:31 am
by loveojha2
I am kind of confused with your post about the content of the Hashed File,

are you saying that your Hashed File is actually having the exchange rate?

If yes, then it's a lookup. (I guess this is what your case is)

If it is containing the data to be converted then it has to be processed for each row.

About the performance, I don't think it would cost too much if it's just a lookup for the exchange rate else if you are doing every thing in the routine then of course it depends on the complexity of the routine (But this can also be optimised, if many transaction are on a single date).

We would need more information, how are planning to do it?
What are the steps invloved in your routine?

Posted: Wed Aug 09, 2006 2:39 am
by kumar_s
the date , the currency code, the desired currency code and the sum
This will be input. But you need to have a hash file (in your case) which holds the conversion rate for that date. So that you can do a lookup on the date and or the currency code to get the conversion rate for that poit of time.
And this hash file should be refreshed periodically.
As said, this can be accomplished by lookup. So you dont need to write a routine.

Posted: Wed Aug 09, 2006 3:01 am
by ray.wurlod
The technology will allow you to take a feed from a site such as XE.com to guarantee that your exchange rates are as up to date as possible.