Page 1 of 1

How to convert Char(20) to Bigint

Posted: Wed Jul 07, 2010 8:03 am
by anjireddy
Hi All,

I have a scenario where I need to convert Char(20) field to Bigint fiel


I tried to do it using Modify stage

Specification Newcolumn:int64=oldcolumn

The job is finishing with warning but the data is not getting populated after Modify stage.

The warning is as below
TRNS_req_attributes: When checking operator: On output data set 0: When binding output schema variable "APT_TRoutput0Rec0": When binding output interface field "Tag1GST_I" to field "GST_I": Implicit conversion from source type "string[20]" to result type "int64": Converting string to number.


Thanks in Advance

Posted: Wed Jul 07, 2010 8:06 am
by ArndW
The implicit conversion cannot deal with spaces, which your CHAR() column most certainly has. I would use an explicit TRIM and StringToDecimal call to avoid all warnings and errors. I am not at a DataStage computer where I can check the syntax of these calls, but the Parallel Job Developers guide will have some examples for the modification stage syntax and conversion calls.

Posted: Wed Jul 07, 2010 11:27 am
by laknar

Code: Select all

AsInteger(TrimLeadingTrailing(InPutColumn))
Or

Code: Select all

StringToDecimal(TrimLeadingTrailing(InPutColumn))

Posted: Wed Jul 07, 2010 11:13 pm
by chvenkat.v
If your issue solved then please make this topic as resolved.