Modify Stage - Implicit conversion
Moderators: chulett, rschirm, roy
Modify Stage - Implicit conversion
Hi
I am trying to configure the modify stage. The job execute with success, but with warning in log:
Modify_12: When checking operator: When binding output schema variable "outRec": When binding output interface field "FXCRMCDPCC" to field "FXCRMCDPCC": Implicit conversion from source type "int32" to result type "string[2]": Converting number to string.
My job: SQ --> SORT --> MODIFY --> SQ
I have one column integer. I try modify to string datatype in modify stage: FXCRMCDPCC:string[2] = FXCRMCDPCC
I need conversions: Interger(2) -> Char(2)
Decimal(6) -> Char(6)
Anybody can help me?
Thank you in advance.
Regards,
Luciana
I am trying to configure the modify stage. The job execute with success, but with warning in log:
Modify_12: When checking operator: When binding output schema variable "outRec": When binding output interface field "FXCRMCDPCC" to field "FXCRMCDPCC": Implicit conversion from source type "int32" to result type "string[2]": Converting number to string.
My job: SQ --> SORT --> MODIFY --> SQ
I have one column integer. I try modify to string datatype in modify stage: FXCRMCDPCC:string[2] = FXCRMCDPCC
I need conversions: Interger(2) -> Char(2)
Decimal(6) -> Char(6)
Anybody can help me?
Thank you in advance.
Regards,
Luciana
Re: Modify Stage - Implicit conversion
Hi Luciana,Luciana wrote:Hi
I am trying to configure the modify stage. The job execute with success, but with warning in log:
Modify_12: When checking operator: When binding output schema variable "outRec": When binding output interface field "FXCRMCDPCC" to field "FXCRMCDPCC": Implicit conversion from source type "int32" to result type "string[2]": Converting number to string.
My job: SQ --> SORT --> MODIFY --> SQ
I have one column integer. I try modify to string datatype in modify stage: FXCRMCDPCC:string[2] = FXCRMCDPCC
I need conversions: Interger(2) -> Char(2)
Decimal(6) -> Char(6)
Anybody can help me?
Thank you in advance.
Regards,
Luciana
For Decimal(6) -> Char(6), use the conversion function new_col_name:string = string_from_decimal(old_col_name)
For conversion from int to char... i fear there is no function available as such...or you may try using 2 Modify stages..first to convert int to decimal and then from decimal to string
I used the transformer stage and the job finished with success, but I thought that the modify stage was more suitable.
Regards,
Luciana.
Code: Select all
Interger(2) -> Char(2)
----------------------
Modify : FXCRMCDPCC:string[2] = FXCRMCDPCC
Conversion : ok
Status : Finished (see log)
Log : Modify_12: When checking operator: When binding output schema variable "outRec": When binding output interface field "FXCRMCDPCC" to field "FXCRMCDPCC": Implicit conversion from source type "int32" to result type "string[2]": Converting number to string.
Transformer: no function in derivation
Conversion : ok
Status : Finished
============================================
Decimal(2) -> Char(10)
----------------------
Modify : FXCRMCDPCC:string = string_from_decimal(FXCRMCDPCC)
Conversion : ok
Status : Finished (see log)
Log : OUTFILE01: When checking operator: When binding input interface field "FXCRMCDPCC" to field "FXCRMCDPCC": Implicit conversion from source type "string" to result type "string[10]": Possible truncation of variable length string.
Transformer: no function in derivation
Conversion : ok
Status : Finished
Luciana.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Actually the warning there is about string to string[size] - that is, unbounded string to bounded string. Not sure where that's coming from, but it's clearly not covered by the NOWARN specification. Do you have a VarChar with no precision (length) anywhere in the design?
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:
My guess is that the unbounded string is the result of string_from_decimal(). Check with your support provider. Can you post the actual text of your conversion specification as it now stands?
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:
Actual text of my conversion specification is:
Specification: FXCRMCDPCC = substring[1,2] (FXCRMCDPCC)
Specification: nowarn
Thus the result is "01". I tried to use the string_from_decimal function together substring function but the job abort.
Before (the result was "01.")
Specification: FXCRMCDPCC:string = string_from_decimal(FXCRMCDPCC)
Specification: nowarn
With both specification above come back warning, but using transformer (Derivation to remove "." of the result: trim(sort.FXCRMCDPCC)[1,2]) this is solved.
Solution:
Integer to string: Transformer or Modify (nowarn) - ok
Decimal to string: Transformer - ok
Specification: FXCRMCDPCC = substring[1,2] (FXCRMCDPCC)
Specification: nowarn
Thus the result is "01". I tried to use the string_from_decimal function together substring function but the job abort.
Before (the result was "01.")
Specification: FXCRMCDPCC:string = string_from_decimal(FXCRMCDPCC)
Specification: nowarn
With both specification above come back warning, but using transformer (Derivation to remove "." of the result: trim(sort.FXCRMCDPCC)[1,2]) this is solved.
Solution:
Integer to string: Transformer or Modify (nowarn) - ok
Decimal to string: Transformer - ok
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: