timestamp problem

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
laxmi_etl
Charter Member
Charter Member
Posts: 117
Joined: Thu Sep 28, 2006 9:10 am

timestamp problem

Post by laxmi_etl »

Hi,

I have 'X' field in my job it is coming in as a varchar(16) we are converting it as
timestamp in the transformer .We don't have any conversion problem.
some reason we couldn't load the data into the main table.I Know the problem is with this field only. When I try to load with the current timestamp for this 'X' field it's loading.
I found that there is somedata in this field of Hours portion has >23 value and in the Seconds >60 so I tried to run the job to handle this with the fallowing function

If X [9,2]>24 or X[11,2]>60 Then '00' Else Trim(StringToDate(X[1,8],"%yyyy%mm%dd") : ' ' :
StringToTime(X[9,4] : "00" ,"%hh%nn%ss"))

But this is not working too.
Do you have any other thaughts.

Thanks.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Take a minute and review your if then else statement. If the hour and seconds are greater than 23 and 59 respectively, then 00. :?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What does the source "timestamp" look like? VarChar(16) is quite an unusual data type for a timestamp.

Verify that you're getting the correct source data and results by creating a small test job that sends its output to a text file, and investigate that file.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

Check your If then Else statement, you are assigning '00' to the timestamp field itself. Use stage variable to adjust that before doing the stringto timestamp conversion.
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
Post Reply