Hi Friends,
In my database, the Decimal values use comma(,) instead of deciaml points (.).
The values when read in DataStage hence treated as String (e.g -15,89 which actualy is -15.89).
How do I convert the comma into decimal??
Thx.
Comma to Decimal Point Substitution
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 273
- Joined: Wed Oct 18, 2006 12:20 pm
- Location: Porto
Re: Comma to Decimal Point Substitution
[quote="asitagrawal"]Hi Friends,
In my database, the Decimal values use comma(,) instead of deciaml points (.).
The values when read in DataStage hence treated as String (e.g -15,89 which actualy is -15.89).
Hi Asit,
You can use following function
Ereplace(Arg1,char(44),char(46))
Arg1 is the field name it will return the desired values.
In my database, the Decimal values use comma(,) instead of deciaml points (.).
The values when read in DataStage hence treated as String (e.g -15,89 which actualy is -15.89).
Hi Asit,
You can use following function
Ereplace(Arg1,char(44),char(46))
Arg1 is the field name it will return the desired values.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I believe you'll find that no decimal placeholder character is stored at all; it is applied when extracting decimal data from the database. The fact that it is a comma suggests that you are in a European locale.
If you are running DataStage with NLS enabled, you can set your locale differently.
The answer posted by swarnkar will work, too, because inside DataStage there are no data types; your decimal number can be treated as a string. Convert() is a more efficient function than Ereplace() for this task, however.
But are "." characters really correct? Just because they're what you want, why is it that the owner of the data chooses to represent them as comma? Is it because that's the naturally expected representation there? In your position I'd check that before unilaterally converting to ".".
If you are running DataStage with NLS enabled, you can set your locale differently.
The answer posted by swarnkar will work, too, because inside DataStage there are no data types; your decimal number can be treated as a string. Convert() is a more efficient function than Ereplace() for this task, however.
But are "." characters really correct? Just because they're what you want, why is it that the owner of the data chooses to represent them as comma? Is it because that's the naturally expected representation there? In your position I'd check that before unilaterally converting to ".".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.