Can't get milliseconds on my timestamp

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
ggarze
Premium Member
Premium Member
Posts: 78
Joined: Tue Oct 11, 2005 9:37 am

Can't get milliseconds on my timestamp

Post by ggarze »

I have a string "2011-01-05 06:10:30,339" that I try to move to a timestamp field but no matter what I try the milliseconds are getting cut off. The timestamp is defined as timestamp len=23 scale=3.

inside a transformmer I've tried:
StringToTimestamp(field,"%yyyy-%mm-%dd %hh:%nn:%ss,%SSS")
StringToTimestamp(field,"%yyyy-%mm-%dd %hh:%nn:%ss.3")

and nothing is working as I keep getting the timestamp without milliseconds
2011-01-05 06:10:30

any advice?
thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Try

Code: Select all

StringToTimestamp(field,"%yyyy-%mm-%dd %hh:%nn:%ss,3") 
or

Code: Select all

StringToTimestamp(field,"%yyyy-%mm-%dd %hh:%nn:%ss,%sss") 
or

Code: Select all

StringToTimestamp(Convert(",",".",field),"%yyyy-%mm-%dd %hh:%nn:%ss.3") 
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ggarze
Premium Member
Premium Member
Posts: 78
Joined: Tue Oct 11, 2005 9:37 am

Post by ggarze »

Thanks for the response. I tried those as well. I just did happen to stumble on to the issue. In the 'Extended' column within the transformmer I had to select miroseconds and it worked when writing to the database. When writing to the file I had to select miroseconds as well. In addition on the sequential file stage I had to put the format of the timestamp as well for it to write to the file. ,"%yyyy-%mm-%dd %hh:%nn:%ss,%SSS") .

Then when i extracted from the table just to see if it worked again i had to set the extended to microseconds there too.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I had assumed you'd set the Extended property, since you were already talking about microseconds.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ggarze
Premium Member
Premium Member
Posts: 78
Joined: Tue Oct 11, 2005 9:37 am

Post by ggarze »

Yeah I'm coming from a server background. Parallel has been quite the adventure with things like this so far.
Post Reply