More accurated timestamp than Oconv(@TIME,"MTS")

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
Sergiomho
Participant
Posts: 7
Joined: Wed Nov 09, 2011 12:45 pm

More accurated timestamp than Oconv(@TIME,"MTS")

Post by Sergiomho »

With this conversion Oconv(@TIME,"MTS") it only shows up to the seconds of the @Time argument

I want to see the .nnn ( .ff)

Is there somehow to do it?

I need the timestamp formatted as:
yyyy-mm-dd-hh.mm.ss.nnnnnn

Using the original .nnn, not .0000 (zeros are not what I need, I want to see the original value in @TIME)

I'm using the following expression:
Oconv(@DATE,"D-YMD[4,2,2]"):'-':Oconv(@TIME,"MTS")

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

Post by ray.wurlod »

Rather than Time(), you can use System(12) to return the number of milliseconds since midnight.

Note: you need to have $OPTIONS TIME.MILLISECONDS asserted.

Microseconds are not possible using DataStage BASIC, though you might be able to invoke a system routine. However, not all operating systems support beyond milliseconds. Plus, the overhead of calling a system function might well, itself, be hundreds of 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.
Sergiomho
Participant
Posts: 7
Joined: Wed Nov 09, 2011 12:45 pm

Post by Sergiomho »

For example, I'm actually using:

Oconv(@DATE,"D-YMD[4,2,2]"):'-':Oconv(@DATE,"MTS")

Because the argument @DATE is a string field.

This is the timestamp from a record, saved in a file.

Reading this field as string and I want to save it in a table using milliseconds.

But using Oconv(@TIME,"MTS") it only shows until seconds.

I want to save in the table the record even with milliseconds
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Read my reply again.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Sergiomho
Participant
Posts: 7
Joined: Wed Nov 09, 2011 12:45 pm

Post by Sergiomho »

Actually I can't read your entire post... it says something of "premium content"...

:(

Could you send me what you wrote to my email?

sergiomho @ gmail . com

Thank you!
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

That part of my answer that you can see gives you your answer.

The easiest way to see the entirety of premium posters' posts is to obtain a premium membership. This is the mechanism used to fund the continued existence of DSXchange (hosting and bandwidth costs).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

Just sign up. It works out to only a few dollars per month...
Choose a job you love, and you will never have to work a day in your life. - Confucius
Post Reply