Typeconversion in Modify giving warning

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
meet_deb85
Premium Member
Premium Member
Posts: 132
Joined: Tue Sep 04, 2007 11:38 am
Location: NOIDA

Typeconversion in Modify giving warning

Post by meet_deb85 »

Hi all,
I m trying to convert varchar(20) to bigint 20 using modify stage.As it is written in the manual that for string to int64 conversion,there is no need to write any function i.e. it is default.

but when i m running a job,data is going to output link of modify stage.
Job is giving warning message as:-

Sequential_File_5: When checking operator: When binding input interface field "b" to field "b": Implicit conversion from source type "string[max=18]" to result type "int64": Converting string to number.

Can anyone help me to resolve this issue.

Thanks [/b]
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

If you have spaces that will not handled in implicit conversion. Use Trim and StringToDecimal functions.
You are the creator of your destiny - Swami Vivekananda
meet_deb85
Premium Member
Premium Member
Posts: 132
Joined: Tue Sep 04, 2007 11:38 am
Location: NOIDA

Post by meet_deb85 »

anbu wrote:If you have spaces that will not handled in implicit conversion. Use Trim and StringToDecimal functions.
Hi
There is no space in source data because when i m using Transformer instead of Modify it working perfectly fine but in modify its giving warning message!

and StringTodecimal function i cant use in Modify,instead there is Decima_from_String function,but can you help me to write the code for conversion;
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Code: Select all

outputFieldName:int64=decimal_from_string(inputFieldName)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
myukassign
Premium Member
Premium Member
Posts: 238
Joined: Fri Jul 25, 2008 8:55 am

Post by myukassign »

Hi ray.... I am facing the same issue and I tried

outField:int64=decimal_from_string(stock_num) but not working.


Warning: Sequential_File_2: When checking operator: When binding output interface field "stock_num" to field "outField": Conversion from source type "string[max=10]" to result type "decimal[1,0]": Possible range limitation.

Error After that: Sequential_File_2,0: Un-handled conversion error on field "stock_num " from source type "string[max=10]" to destination type "int64":
source value="100"; the result is non-nullable and there is no handle_null to specify a default value.
Post Reply