Hi,
In project,we need get time-stamp and what we are doing is achieving this via CurrentTimestamp() function in D/S transformer stage but we can only get a value timed to second such as '2004-03-02 16:28:26', and now we wanna one value timed to microsecond such as '2010-08-05 13:29:09.970000',is there any way.
BTW,current datastage version is 7.5.1:
uv -admin -version
DataStage 7.5.1.2
Appreciating your input in advance,
Thanks,
How to get timestamp with microsecond
Moderators: chulett, rschirm, roy
How to get timestamp with microsecond
Let's Progress Together....
Try CurrentTimestampMS() and set the extended properties of the column to include micro seconds and set length to 26 and scale to 6.
CurrentTimestamp() will give just seconds as you presented if the extended properties are not set. If they are you would get 000000 as the micro seconds.
Using CurrentTimestampMS() should solve your issue.
CurrentTimestamp() will give just seconds as you presented if the extended properties are not set. If they are you would get 000000 as the micro seconds.
Using CurrentTimestampMS() should solve your issue.
Mike Hester
mhester@petra-ps.com
mhester@petra-ps.com
Hi chulett,thanks a lot for reply, OS is AIX 5.1,I seached the forum,but unble to get the answerchulett wrote:What operating system? An exact search for "microsecond" should turn up other conversations on this topic, including (from what I recall) the operating systems where this does or does not work.
Let's Progress Together....
Hi mhester,many thanks for reply,I tried you method but I'm unabe to see fucntion CurrentTimestamp() in the transfermor stage,,seems 7.X D/S has no function CurrentTimestampMS()mhester wrote:Try CurrentTimestampMS() and set the extended properties of the column to include micro seconds and set length to 26 and scale to 6.
CurrentTimestamp() will give just seconds as you presented if the extended properties are not set. If they are you would get 000000 as the micro seconds.
Using CurrentTimestampMS() should solve your issue.
Let's Progress Together....
You may need to upgrade or roll you own. Also, Mike has already mentioned this but so has Arnd in the past:
Have you enabled that attribute?ArndW wrote:You will need to declare your Timestamp column with the extended attribute of "microseconds" in order to store fraction seconds.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Here you go - something to get you started with your own -
Code: Select all
char *pfGetTimestamp()
{
char* returnBuffer;
TimeStampStringValue = APT_TimeStamp::now(true).asString();
returnBuffer = TimeStampStringValue.content();
return returnBuffer;
}
Mike Hester
mhester@petra-ps.com
mhester@petra-ps.com