Time and TimeStamp with microseconds

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

vijayrc
Participant
Posts: 197
Joined: Sun Apr 02, 2006 10:31 am
Location: NJ

Post by vijayrc »

chulett wrote:I doubt you're "going wrong" anywhere. Just seems like you need to translate the colons into periods after you've gotten the timestamp, if you really need it in that format.
That's what I thought, but I'm looking for a simpler solution in getting a period instead of a colon in the time format.
By what you say, I get the current timestamp, and needs to replace the colon with period, and there I'm struck..
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Doesn't really get any simpler. Don't you have the Convert function in PX? Or EReplace? While I agree it would be best to generate it the way you want it, but failing that it is easy enough to swap the delimiters:

Code: Select all

Convert(":",".",YourTimestamp)
Perhaps another function would be more appropriate, but it shouldn't be much more than that.
-craig

"You can never have too many knives" -- Logan Nine Fingers
vijayrc
Participant
Posts: 197
Joined: Sun Apr 02, 2006 10:31 am
Location: NJ

Post by vijayrc »

chulett wrote:Doesn't really get any simpler. Don't you have the Convert function in PX? Or EReplace? While I agree it would be best to generate it the way you want it, but failing that it is easy enough to swap the delimiters:

Code: Select all

Convert(":",".",YourTimestamp)
Perhaps another function would be more appropriate, but it shouldn't be much more than that.
Thanks and it worked with the Convert Option.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Except that you're not the original author I'd suggest that the thread be marked as Resolved.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
steele
Premium Member
Premium Member
Posts: 12
Joined: Thu Jul 14, 2005 2:16 pm

Post by steele »

Getting back to the original problem posted: getting the microseconds moved into the database table, we have found a simple solution: in a transform, change the datatype from Timestamp to Char(26) for the link to the db stage, even though the actual table is defined as Timestamp. This works, at least, with Oracle and TeraData.

Enjoy!
Paul
bmarko22
Participant
Posts: 21
Joined: Mon Nov 16, 2009 7:03 am
Location: MD

Post by bmarko22 »

ArndW wrote:Has this been fixed in DS 7.5.2 ?[/b] I don't get the microseconds with the options mentioned in the manual %yyyy-%mm-%dd %hh:%nn:%ss.x where x is a no between 0 and 6 for the microseconds. I have the Job Parameter override for Timestamp to be %yyyy-%mm-%dd %hh:%nn:%ss.6 Compile goes thru, but the job fails. I'll post the message later.
Adding .6 worked for me.. thanks. (%yyyy-%mm-%dd %hh:%nn:%ss.6)
Post Reply