Data type conversion

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
mydsworld
Participant
Posts: 321
Joined: Thu Sep 07, 2006 3:55 am

Data type conversion

Post by mydsworld »

What is the function to convert a STRING type to Integer in server job or in BASUC Transformer.
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

Server is sort of a strange beast - it defines it by usage. Use a string as a number, and (if the string contains a valid number) it will do the conversion automatically.
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
mydsworld
Participant
Posts: 321
Joined: Thu Sep 07, 2006 3:55 am

Post by mydsworld »

Actually am trying to convert timestamp to Integer, so am having the following as string :
Trim(Oconv(Date(),"D-YMD[4,2,2]"),"-","a") : Trim(Oconv(Time(),"MTS"),":","a")

eg 20090521162367

I need to convert it to Integer or Bigint

Please advise.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

There's no explicit conversion needed in Server, just strip the delimiters before you move it to the target field. One easy way to do that is to use the DIGITS transform.
-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 »

Moderator: please move to Server forum
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