Does DataStage have an internal timestamp format?

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
sbass1
Premium Member
Premium Member
Posts: 211
Joined: Wed Jan 28, 2009 9:00 pm
Location: Sydney, Australia

Does DataStage have an internal timestamp format?

Post by sbass1 »

Hi,

FWIW, I did read the doc and searched the forum before posting. If the answer is in here I missed it...

Does DS have an internal timestamp (or what SAS calls a datetime) format?

IOW, if (straight from the doc):

X = Iconv("1997 5 27", "D YMD") X = 10740

and

X = Iconv("02:46:40", "MTS") X = 10000

then could I do (made up syntax and results):

X = Iconv("1997-05-27 02:46:40", "DT YMD MTS") X = 123456789

where X is say the number of seconds since 31Dec1967?

I've looked at some of Ray's Date routines, and it seems that timestamps are always handled as datepart and timepart separately, with no internal representation of a timestamp value.

If there is an internal timestamp format, are there various oconv patterns to reformat the internal representation for output?

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

Post by ray.wurlod »

Your understanding is correct. DataStage does not have an internal representation of timestamp in server jobs/DataStage BASIC.

I tend to use a delimited represenation, for example 14788\10360, where the bit to the left of the delimiter character is the date and the bit to the right is the time part. This allows me to have fractional seconds if need be, for example 14788\10360.456
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

And to address the second part of your question - OCONV is exactly what is used to convert that internal date and time formats to various output formats. Check the BASIC guide found in the help documentation. For Release 7.5 it is listed in the second page of help guides. Appendix C contains a comprehensive overview of the conversion codes you can use with OCONV.

Ray - No mention of Dick Pick's Birthday :-) in your response on the internal date?
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

None.
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