Whats does this mean?
Moderators: chulett, rschirm, roy
Whats does this mean?
convert('.','',trim(l_SuperListInfo_1.ZPROMID:''))
What does the text in RED mean?. The data type of the ZPROMID column is decimal.
The column is being converted from CHAR to DECIMAL using a MODIFY stage and then before writing it to a SEQ file, the above derivation is given. Can anyone please let me know what that does ?
What does the text in RED mean?. The data type of the ZPROMID column is decimal.
The column is being converted from CHAR to DECIMAL using a MODIFY stage and then before writing it to a SEQ file, the above derivation is given. Can anyone please let me know what that does ?
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Find out who created the expression and ask them!
Looks like a clumsy attempt to force an implicit conversion to string so that the Trim() function can be applied. But it's wrong.
The proper way is to use an appropriate conversion function, such as StringToDecimal() in a Transformer stage or string_from_decimal() in a Modify stage.
Looks like a clumsy attempt to force an implicit conversion to string so that the Trim() function can be applied. But it's wrong.
The proper way is to use an appropriate conversion function, such as StringToDecimal() in a Transformer stage or string_from_decimal() in a Modify stage.
Last edited by ray.wurlod on Thu Jan 04, 2007 4:16 pm, edited 1 time in total.
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
It would in a server/BASIC expression. Appending no characters to a string returns the original string.
This is also true in a parallel expression, except that concatenation to a Decimal data type is prohibited. (You have marked the job type as parallel.)
This is also true in a parallel expression, except that concatenation to a Decimal data type is prohibited. (You have marked the job type as parallel.)
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.
Sorry abt the wrong place posted at...ray.wurlod wrote: Find out who created the expression and ask them!
Looks like a weird attempt to force an implicit conversion to string so that the Trim() function can be applied. But it's wrong.
The proper way is to use an appropriate conversion function, such as StringToDecimal() in a Transformer stage or string_from_decimal() in a Modify stage.
I think you are right .... The field is modified in the MODIFY stage with this statement
ZPROMID:decimal[8,0]= decimal_from_string(ZPROMID)
And then in the following transformer this is the derivation for the field
convert('.','',trim(l_SuperListInfo_1.ZPROMID:''))
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
So that ZPROMID is a string by the time it gets into this expression, and appending a zero-length string to it leaves it unaffected.
Looks like the problem for the original developer was between the keyboard and the chair.
Looks like the problem for the original developer was between the keyboard and the chair.
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.
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America