Conversion from numeric to string in a job

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
bgs_vb
Premium Member
Premium Member
Posts: 79
Joined: Mon Jan 02, 2006 5:51 am

Conversion from numeric to string in a job

Post by bgs_vb »

Hi,

I need to convert NUMERIC(10) datatype to NVARCHAR(10) in Parallel Job from desinger. when i change the type and execute it throws error.

is there a way to do it.

Thanks,
Vindy
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What did you try and what error did you get?
-craig

"You can never have too many knives" -- Logan Nine Fingers
bgs_vb
Premium Member
Premium Member
Posts: 79
Joined: Mon Jan 02, 2006 5:51 am

Post by bgs_vb »

I changed the datatype in designer from numeric to nvarchar and i try to run the job i get the following:


Error when checking operator: When binding output schema variable "resRec": When binding output interface field "NOMINATION_KEY" to field "NOMINATION_KEY": Implicit conversion from source type "decimal[10,0]" to result type "ustring[max=10]": Not enough room in ustring for decimal[10,0].

What should i do to convert type in desinger.

Thanks,
Vindy
bgs_vb
Premium Member
Premium Member
Posts: 79
Joined: Mon Jan 02, 2006 5:51 am

Post by bgs_vb »

I changed the datatype in designer from numeric to nvarchar and i try to run the job i get the following:


Error when checking operator: When binding output schema variable "resRec": When binding output interface field "NOMINATION_KEY" to field "NOMINATION_KEY": Implicit conversion from source type "decimal[10,0]" to result type "ustring[max=10]": Not enough room in ustring for decimal[10,0].

What should i do to convert type in desinger.

Thanks,
Vindy
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Let me clarify. You simply changed the data type - you did not use any explicit data type conversion function. Is this correct?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
bgs_vb
Premium Member
Premium Member
Posts: 79
Joined: Mon Jan 02, 2006 5:51 am

Post by bgs_vb »

yes you are correct. Is that the correct way to do, if not how could i go ahead in doing the change.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

That is not the correct way to do this, even though it is allowed. There is a modify stage which is designed to do conversions such as this.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Or even the transformer stage which has Parallel Job Functions, specifically conversion functions, to perform this.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
karrisuresh
Participant
Posts: 57
Joined: Sat Jun 09, 2007 1:14 am
Location: chicago

Post by karrisuresh »

Hi I guess In the transformer,
left pane bottom put the datatype of the source
and in the right pane bottom put the datatype of the target

Now in the drag and drop canvas
right click on the derivation part,
u can see the type conversion functions
and which ever conversion u want u can go ahead
this will eliminate the warnings tooo
thanks
suresh
bgs_vb wrote:yes you are correct. Is that the correct way to do, if not how could i go ahead in doing the change.
Hi I have experience in parallel extender datastage I am ready to give/take help from other
hope we all help each other hand in hand
karrisuresh
Participant
Posts: 57
Joined: Sat Jun 09, 2007 1:14 am
Location: chicago

u can do this in the following way

Post by karrisuresh »

Hi I guess In the transformer,
left pane bottom put the datatype of the source
and in the right pane bottom put the datatype of the target

Now in the drag and drop canvas
right click on the derivation part,
u can see the type conversion functions
and which ever conversion u want u can go ahead
this will eliminate the warnings tooo
thanks
suresh
bgs_vb wrote:yes you are correct. Is that the correct way to do, if not how could i go ahead in doing the change.
Hi I have experience in parallel extender datastage I am ready to give/take help from other
hope we all help each other hand in hand
karrisuresh
Participant
Posts: 57
Joined: Sat Jun 09, 2007 1:14 am
Location: chicago

u can do this in the following way

Post by karrisuresh »

Hi I guess In the transformer,
left pane bottom put the datatype of the source
and in the right pane bottom put the datatype of the target

Now in the drag and drop canvas
right click on the derivation part,
u can see the type conversion functions
and which ever conversion u want u can go ahead
this will eliminate the warnings tooo
thanks
suresh
bgs_vb wrote:yes you are correct. Is that the correct way to do, if not how could i go ahead in doing the change.
Hi I have experience in parallel extender datastage I am ready to give/take help from other
hope we all help each other hand in hand
karrisuresh
Participant
Posts: 57
Joined: Sat Jun 09, 2007 1:14 am
Location: chicago

Re: Conversion from numeric to string in a job

Post by karrisuresh »

Hi I guess In the transformer,
left pane bottom put the datatype of the source
and in the right pane bottom put the datatype of the target

Now in the drag and drop canvas
right click on the derivation part,
u can see the type conversion functions
and which ever conversion u want u can go ahead
this will eliminate the warnings tooo
thanks
suresh
bgs_vb wrote:Hi,

I need to convert NUMERIC(10) datatype to NVARCHAR(10) in Parallel Job from desinger. when i change the type and execute it throws error.

is there a way to do it.

Thanks,
Vindy
Hi I have experience in parallel extender datastage I am ready to give/take help from other
hope we all help each other hand in hand
Post Reply