string to decimal error conversion

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

kjaouhari
Participant
Posts: 325
Joined: Thu Mar 16, 2006 10:22 am

string to decimal error conversion

Post by kjaouhari »

Hello all,

My job is aborting because of this error generated by aggregator stage:
Value treated as NULL
Attempt to convert String value "26.50" to Decimal type unsuccessful

The think is the data looks like a decimal and the data type is also decimal.
Does anything need to be change on NLS ?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

No, this has nothing to do with NLS. Perhaps there are "hidden" characters in the string and I seem to recall that spaces cause issues as well. Do the explicit conversion in a modify or transform stage and you can also implement the IsValid() function to check on validity.
kjaouhari
Participant
Posts: 325
Joined: Thu Mar 16, 2006 10:22 am

Post by kjaouhari »

I was thinking that it has to do with NLS cause when the decimal value is with coma then it works.
Again the issue is within the aggregator, I need to set the decimal value in aggregator with dot and not coma.
I did change the NLS many times but still ask for coma as decimal.
kjaouhari
Participant
Posts: 325
Joined: Thu Mar 16, 2006 10:22 am

Post by kjaouhari »

Does anybody know how to set decimal value with dot instead of coma in aggregator ?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The "," comma is the decimal separator in several NLS locales so you are correct and I was wrong - it is likely to do with NLS after all. What Locale do you have set - in German, for example, the default decimal separator is the "," character. Also, in the "edit row" attributes for the column in question, do you have "decimal separator" set - if not, try putting in a decimal point.
kjaouhari
Participant
Posts: 325
Joined: Thu Mar 16, 2006 10:22 am

Post by kjaouhari »

Thanks ArndW,
Any idea on wich NLS will be suitable for this ? I'm testing lot of them unsuccessfuly so far.

I've checked some previous posts and this issue seems to be related to anyone that need to migrate from 7.1 to 8 with NLS enabled.
kjaouhari
Participant
Posts: 325
Joined: Thu Mar 16, 2006 10:22 am

Post by kjaouhari »

Thanks ArndW,
Any idea on wich NLS will be suitable for this ? I'm testing lot of them unsuccessfuly so far.

I've checked some previous posts and this issue seems to be related to anyone that need to migrate from 7.1 to 8 with NLS enabled.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The actual character set is not important - it is the NLS Locale which affects such things as date & time format, decimal separators, currency and collating order.
kjaouhari
Participant
Posts: 325
Joined: Thu Mar 16, 2006 10:22 am

Post by kjaouhari »

Unfortunately, when I change those NLS settigns in US -ENGLISH , still the decimal is not recognized. And There is no NLS tab within the aggregator stage. I'm going to check if there is anything to do on administrator ...
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Did you try explicitly setting the delimiter in the column definition?
kjaouhari
Participant
Posts: 325
Joined: Thu Mar 16, 2006 10:22 am

Post by kjaouhari »

I don't see any location in aggregator where I can set the delimiter .
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

right-mouse click on the column and choose "edit row"
kjaouhari
Participant
Posts: 325
Joined: Thu Mar 16, 2006 10:22 am

Post by kjaouhari »

ok , but still don't really see where and how to set the delimiter :wink:
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

There is a category called "decimal separator" which lets you specify which character you wish to use.
kjaouhari
Participant
Posts: 325
Joined: Thu Mar 16, 2006 10:22 am

Post by kjaouhari »

Don't have such thing in aggregator stage.
Post Reply