char to integer32

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
ds_is_fun
Premium Member
Premium Member
Posts: 194
Joined: Fri Jan 07, 2005 12:00 pm

char to integer32

Post by ds_is_fun »

Char to numeric conversion. Any suggestions?
Last edited by ds_is_fun on Sun Jul 24, 2005 9:46 pm, edited 2 times in total.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

I could not understand your need clearly.....
it seems you need to conver char (source) to int (target) am i right.
int32 is againg the integer right.But it is just a long one.
so if the source is 0000 then it suppose to be reflected as 0 in the target right.

regards
deepak
ds_is_fun
Premium Member
Premium Member
Posts: 194
Joined: Fri Jan 07, 2005 12:00 pm

Post by ds_is_fun »

What could be done to avoid this transformation?
thanks
Last edited by ds_is_fun on Sun Jul 24, 2005 9:46 pm, edited 1 time in total.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Umm... nothing. :? There's nothing wrong with what's happening. Any number of character zeroes sent to an integer field will become a numeric zero.

About the only way to 'avoid this transformation' would be to redefine your target field to be character as well.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Re: char to integer32

Post by ray.wurlod »

ds_is_fun wrote:Char to numeric conversion. Any suggestions?
int32_from_string in Modify stage. Just be very sure that every value can accurately be converted.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
goosarikiran
Participant
Posts: 9
Joined: Tue Jul 26, 2005 11:12 pm
Location: Bangalore

Re: char to integer32

Post by goosarikiran »

ds_is_fun wrote:Char to numeric conversion. Any suggestions?
char is left justified and int is right justified.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

So?

Trim trailing white space if that's necessary.

"12345" can be converted to an integer whether it's left- or right-justified.
Trim("12345 ") can also be happily converted to an integer.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply