decimal_from_string dosent work ?

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

decimal_from_string dosent work ?

Post by ady »

I am trying to change a CHAR to a DECIMAL using modify stage. My source is a DATA SET and the column name is "OFFER_ID". I am using OFFER_ID:decimal[8,0]= decimal_from_string(OFFER_ID).

This does not work. Is there another way to do this?.

I am using a basic transformer in PX , so can I change the datatype in the transformer directly?.... will it work like in the server edition?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can not use Modify stage functions in Transformer stages, and you can not use Modify stage functions in BASIC Transformer stages.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

I was using the function above in a modify stage.


I was just asking that as I am using a basic transformer elsewhere in the job can I change the output datatype in that transformer like we do in the server jobs ?..... thnx
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

What doesn't work? Got any error or got any unexpected result?
You can use Basic Transformer as well. You can use the functions available.
BTW: What forced your to use Basic transformer?
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

decimal_from_string works fine for me, provided that the source column contains eight or fewer numeric characters and nothing else. Perhaps you have a problem with your data?

"It doesn't work" is singularly helpful as diagnostic information. (That's why vets charge more than doctors.)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

"It doesn't work" is singularly helpful as diagnostic information. (That's why vets charge more than doctors.)[/quote] :oops: :lol:


This is the error:

APT_CombinedOperatorController,0: Un-handled conversion error on field "PROMO_ID " from source type "string[8]" to dest type "decimal[8,0]": source value=""6343"": Result is non-nullable and there is no handle_null to specify a default value
Un-handled conversion error on field "OFFER_ID " from source type "string[8]" to dest type "decimal[8,0]": source value=""8894"": Result is non-nullable and there is no handle_null to specify a default value


I'v tried giving NULLABLE, still gives out this error.

How do I specify the null handling property ?



@ Kumar_S


We use 7.0 now, and for some reasons it has to be upgraded to get the parallel transformer, I am not quite sure :?
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

What is the job desing? May be the operator combination might screwed up your function. Try with Combinable operator to false.
If you have parallel version, I dont think transformer is a plugin to upgrade. you should be having the stage, may be you may need to customize your pallet to get the stage in. You can accomplish this fucntionality in the transformer it self, and hence you can eliminate the Modify if its an addition stage just for this purpose.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

@ Kumar

I have the parallel transformer in the palette but we dont have the compiler for it or sumthin. (not quite sure abt the reason )

Modify stage work for me now, turns out the data I have has retained some quotes chars from the previous server job where I am getting the data from.

Thanx for yr help guys. :)
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Get a compiler. It will make your life much easier as transformer is rich in helpful transform functions.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply