How to specify the timestamp format for the field like this?

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
kinsey0514
Participant
Posts: 1
Joined: Wed Jul 02, 2008 6:14 pm

How to specify the timestamp format for the field like this?

Post by kinsey0514 »

when I using a seq stage for reading a file,
i met a field like this format:Apr 13 2006 5:07:49:720PM
In column definition it is type of timestamp
how can i specify the timestamp format for this field
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard.

I don't know that there's a conventional format string for this timestamp format.

I'd try reading it as VarChar and modifying it to a conventional timestamp format (adding 12 to the hours if the designator is PM, changing the decimal placeholder from ":" to ".", changing MDY order to YMD order).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
yulangok
Participant
Posts: 9
Joined: Sun May 27, 2007 9:37 pm

Post by yulangok »

Good question! Very good question, because I also met this question and have not resolved.
shiva_eee4u
Participant
Posts: 5
Joined: Sun Jun 29, 2008 3:51 am

Post by shiva_eee4u »

yulangok wrote:Good question! Very good question, because I also met this question and have not resolved.

Good question..... because I also met this question and have not resolved. Can i will have solution for the problem? Any one plz......
mahadev.v
Participant
Posts: 111
Joined: Tue May 06, 2008 5:29 am
Location: Bangalore

Post by mahadev.v »

Stop praising and applauding. Which part of Ray's answer did you not understand? What approach have you tried so far? What results did you get?
"given enough eyeballs, all bugs are shallow" - Eric S. Raymond
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You could read it as a VarChar (or maybe even Char) and convert it to a conventional timestamp format.

(Which advice I am sure I have given in the past on DSXchange.)
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