Is it possible in DataStage to convert text to timestamp

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
DEVESHASTHANA
Participant
Posts: 47
Joined: Thu Sep 16, 2004 5:26 am
Location: India

Is it possible in DataStage to convert text to timestamp

Post by DEVESHASTHANA »

hi guys,
Is it possible in DataStage to convert text to timestamp
I need it as in my source the EFFDT column is text and in target it is Timestamp.


Thanking u in anticipation,
Regards,
Devesh
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard! :D

The good news is that there are no data types within DataStage. So, if your source data character string is in a valid timestamp format, you can load it straight in to a column whose data type is "TimeStamp".

If your source data character string is not in a valid timestamp format, then you can use substring and concatenation to get it into a valid timestamp format.

You may need to adjust the fractional seconds, or the date picture, depending on your target database.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dsxdev
Participant
Posts: 92
Joined: Mon Sep 20, 2004 8:37 am

Post by dsxdev »

Rightly said by Ray, you can directly write the text to timestamp, if the format is valid timestamp. You have funtion StringtoTimeStamp. But better to directly write the input if in right format else this would unnecessarily increase function call and reduce performance when volume of data is high.
Happy DataStaging
DEVESHASTHANA
Participant
Posts: 47
Joined: Thu Sep 16, 2004 5:26 am
Location: India

THANKS

Post by DEVESHASTHANA »

ray.wurlod wrote:Welcome aboard! :D

The good news is that there are no data types within DataStage. So, if your source data character string is in a valid timestamp format, you can load it straight in to a column whose data type is "TimeStamp".

If your source data character string is not in a valid timestamp format, then you can use substring and concatenation to get it into a valid timestamp format.

You may need to adjust the fractional seconds, or the date picture, depending on your target database.
Post Reply