Page 1 of 1

Does DataStage have an internal timestamp format?

Posted: Sun Feb 22, 2009 9:49 pm
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

Posted: Sun Feb 22, 2009 11:02 pm
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

Posted: Wed Feb 25, 2009 4:30 pm
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?

Posted: Wed Feb 25, 2009 5:35 pm
by ray.wurlod
None.