How to get exact integer value

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
svhari76
Participant
Posts: 48
Joined: Tue Nov 16, 2010 5:04 pm

How to get exact integer value

Post by svhari76 »

Hi All,

I am trying to read data from flat file and looking for record existance in hashedfile(which is populated from DB) . My hashed file contains a numeric field and i am getting it as 3, 4 etc. From the flat file i am getting input as 003, even though i defined the field as smallInt. Because of this my look up fails. How can i convert this 003 value to 3?

I tried using AsInteger function but datastage 7.5.1 doesn't compile.

Can some one help me solving the issue.
Last edited by svhari76 on Fri Dec 17, 2010 1:38 pm, edited 1 time in total.
Hari
bharathappriyan
Participant
Posts: 47
Joined: Fri Sep 23, 2005 6:01 pm

Post by bharathappriyan »

Hi,

Could you please check the data type of the column in the file and in the hashed file?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Conversions in Server are automatic and thus implicit, so just moving it from the flatfile to a numeric column before the lookup should work fine.
-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:

Post by ray.wurlod »

There's no AsInteger() function in server jobs. Please confirm your job type so we don't waste any more time.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
svhari76
Participant
Posts: 48
Joined: Tue Nov 16, 2010 5:04 pm

Post by svhari76 »

I end up being using TRIM function to delete the leading zeros and it works fine now. But if i define SQL data type as smallint,integer it should work but appenrently it did not.
Hari
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Your solution implies that a character field is involved somewhere. Which would also go towards explaining the reason why it didn't work before that. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply