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
sreddy
Participant
Posts: 144 Joined: Sun Oct 21, 2007 9:13 am
Post
by sreddy » Mon Mar 15, 2010 9:38 am
Hi
My source is Char and lookup data is Integer.
I am getting below warning while i am runnig. Every thing is fine.
Lkp_VEN,0: When binding input interface field "LAWSON_VEND_NUM" to field "LAWSON_VEND_NUM": Implicit conversion from source type "string[9]" to result type "int32": Converting string to number.
Please help with related convertion code.
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Mon Mar 15, 2010 10:06 am
Make an explicit conversion using the StringToDecimal() function.
-craig
"You can never have too many knives" -- Logan Nine Fingers
sreddy
Participant
Posts: 144 Joined: Sun Oct 21, 2007 9:13 am
Post
by sreddy » Mon Mar 15, 2010 11:35 am
Thank you Hulett
Can you check this convertion.
StringToDecimal(In_VEN_Ven.LAWSON_VEND_NUM,'Trim(In_VEN_Ven.LAWSON_VEND_NUM, "0", "F")')
When i used this job is aborting.
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Mon Mar 15, 2010 11:54 am
So, do we have to guess what the "abort" is?
-craig
"You can never have too many knives" -- Logan Nine Fingers
sreddy
Participant
Posts: 144 Joined: Sun Oct 21, 2007 9:13 am
Post
by sreddy » Mon Mar 15, 2010 11:56 am
Job status is Abort.
Can you please check below conversion.
StringToDecimal(In_VEN_Ven.LAWSON_VEND_NUM,'Trim(In_VEN_Ven.LAWSON_VEND_NUM, "0", "F")')
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Mon Mar 15, 2010 2:32 pm
sreddy wrote: Job status is Abort.
Understand that. Please tell us
why it aborted, post the fatal error message(s) from the log.
-craig
"You can never have too many knives" -- Logan Nine Fingers
Kryt0n
Participant
Posts: 584 Joined: Wed Jun 22, 2005 7:28 pm
Post
by Kryt0n » Mon Mar 15, 2010 3:24 pm
sreddy wrote: Job status is Abort.
Can you please check below conversion.
StringToDecimal(In_VEN_Ven.LAWSON_VEND_NUM,'Trim(In_VEN_Ven.LAWSON_VEND_NUM, "0", "F")')
Putting the trim function in quotes certainly won't help. Trimming leading zeros is pretty pointless to a decimal, I would be more concerned with non-numeric characters (and spaces?)
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Mon Mar 15, 2010 3:34 pm
Was hoping for a little 'self discovery' along the way from gentle nudges in the proper direction.
-craig
"You can never have too many knives" -- Logan Nine Fingers
Kryt0n
Participant
Posts: 584 Joined: Wed Jun 22, 2005 7:28 pm
Post
by Kryt0n » Mon Mar 15, 2010 3:55 pm
chulett wrote: Was hoping for a little 'self discovery' along the way from gentle nudges in the proper direction.
Apologies for cutting your grass... hopefully he did a bit of self discovery in between
sreddy
Participant
Posts: 144 Joined: Sun Oct 21, 2007 9:13 am
Post
by sreddy » Tue Mar 16, 2010 7:45 am
Thank you both of you
My source data is in Char data type just like below format ( 9 characters)
000000001
000000012
000000120
that is why i used Trim the Zeros.
But my lookup data is integer data type
87654
98653
34765
Help me with related function script StringtoDecimal()
Thanks
SReddy
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Tue Mar 16, 2010 7:52 am
Help us help you. Show us the latest version of your function syntax and post the dang fatal error message(s) from the log.
-craig
"You can never have too many knives" -- Logan Nine Fingers
Sainath.Srinivasan
Participant
Posts: 3337 Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom
Post
by Sainath.Srinivasan » Tue Mar 16, 2010 8:34 am
Just a simple stringToDecimal(yourSourceColumn) must do the trick.
Did you ensure that all downstream column declaration (esp lookup stage) refers to that column as integer ?
sreddy
Participant
Posts: 144 Joined: Sun Oct 21, 2007 9:13 am
Post
by sreddy » Tue Mar 16, 2010 8:51 am
Can you please send me your version of conversion script.
StringtoDecimal()
source is char 000000001
first Trim the zeros from source data with that result we have to convert the data according to lookup data type integer.
i am waiting for your reply.
Thanks
SReddy
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Tue Mar 16, 2010 9:25 am
There's no "conversion script" and no need to trim the dang zeroes. Simply call the function with your source column and populate an Integer field with the results. I am waiting for your reply.
-craig
"You can never have too many knives" -- Logan Nine Fingers
sreddy
Participant
Posts: 144 Joined: Sun Oct 21, 2007 9:13 am
Post
by sreddy » Tue Mar 16, 2010 9:37 am
Thank you Hulett
Below is the warning.
Still job is running.
Lkp_VEN: When checking operator: On output data set 0: When binding output schema variable "outputData": When binding output interface field "LAWSON_VEND_NUM" to field "LAWSON_VEND_NUM": Implicit conversion from source type "int32" to result type "string[9]": Converting number to string.