× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Is this to save bytes?
Timestamps are rather a weird thing. Even though you do a DSPPFM and can see the entire timestamp, and the documentation talks about taking 26 bytes, it really doesn't. There is just something in the database which makes timestamps appear as 26 bytes in DSPPFM, etc. Especially since when they first came out the early versions of RPG treated them as a character field. So they did all this weird stuff to allow the early versions of RPG to handle them. Basically if you stored 1,000,000 date fields they are not going to eat up 26,000,000 bytes

"The internal representation of a timestamp is a string of between 7 and 13 bytes."
https://www.ibm.com/docs/en/db2/10.5?topic=list-datetime-values

"Values whose data types are DATE, TIME, or TIMESTAMP are represented in an internal form that is transparent to the user..."
https://www.ibm.com/docs/en/i/7.4?topic=values-string-representations-datetime

So tricks about looking at DSPPFM and seeing data in it's raw form haven't been true since the dawn of date, time and timestamp fields. IDK if DMPOBJ shows you data. I can see that possibly being a security issue. However, even DMPOBJ could be altered to "unpack" the timestamp in the output.

However I'm not saying you're totally off base. Something has to explain the difference between 7 and 13 in: "The internal representation of a timestamp is a string of between 7 and 13 bytes."
I suspect that the difference is an internal representation of a timestamp with 0 microseconds would be 7 and one with 12 microseconds would be 13. This closely follows packing 12 down to 6 bytes (no sign necessary).
So, in theory, you could be wasting 3 bytes per timestamp field by using DDS if you do not use microseconds. If that's what it takes to get them to switch to DDL then so be it. Otherwise, if you'd like to argue against it, only wasting 3 bytes per column doesn't sound near as bad as wasting 6 bytes per column.

Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.