How to convert Char(20) to Bigint

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
anjireddy
Participant
Posts: 1
Joined: Mon Dec 01, 2008 2:06 pm

How to convert Char(20) to Bigint

Post 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
anji
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
laknar
Participant
Posts: 162
Joined: Thu Apr 26, 2007 5:59 am
Location: Chennai

Post by laknar »

Code: Select all

AsInteger(TrimLeadingTrailing(InPutColumn))
Or

Code: Select all

StringToDecimal(TrimLeadingTrailing(InPutColumn))
Regards
LakNar
chvenkat.v
Participant
Posts: 94
Joined: Fri Dec 14, 2007 3:22 am

Post by chvenkat.v »

If your issue solved then please make this topic as resolved.
Post Reply