« OT = Outta There | Main | 3000 goes in an open direction »

November 07, 2008

Keep the CALENDAR up to date

The year 2027 has been notable for customers who don't plan to leave the HP 3000. That's the year when timestamps stop being accurate, because the CALENDAR intrinsic in MPE/iX only uses 7 bits to store year information.

If your HP 3000 apps are using CALENDAR, HP advises that you use the newer HPCALENDAR. The newer intrinsic extends the 3000's date accuracy for more than 30 years beyond 2008. Yes, that's right; 2038 will be the last year to accurately store timestamps.

HP's advisory, which got referenced by its support and patch tracker today, explains the differences. At least in part:

The original MPE timestamp format was that used by the CALENDAR intrinsic, a 16 bit quantity allowing 9 bits for the day of the year and 7 bits for the year, added to 1900. Since the largest number represented by 7 bits is 127, this format is limited to accurately storing years up to 2027.

The newer HPCALENDAR intrinsic uses a 32 bit quantity, allowing 23 bits for the year, since 1900 and the same 9 bits for the day of the year. This format provides a significantly longer period of timestamp accuracy.

When HP began to talk about a Posix timestamp function that works on the 3000, the advice needed a bit of explanation from HP's 3000 lab engineer Bill Cadier.

Cadier reports

If, for example someone needs to store the maturity date for a 30 year mortgage started this month, neither the traditional CALENDAR format nor the time() format will work as they are only accurate to 31 December 2027 and 19 January 2038 respectively. The HPCALENDAR date format provides 23 bits to store the year added to 1900 — and since one can store 8,388,607 in those 23 bits, this format provides the best accuracy for storing future dates on the e3000.

The advisory, which you can read for yourself at the HP IT Response Center Web site, says in part

Certain POSIX applications may use the time() function as the basis for timestamps; and may therefore, store timestamps in the format used by time(), which is a 32 bit quantity representing the number of seconds from the epoch 1 January 1970. This format is limited to accurately storing timestamps up to 19 January 2038.

If your applications have a need to create and store future transaction timestamps, HP recommends using HPCALENDAR, HPDATECONVERT, HPDATEDIFF, HPDATEFORMAT or HPDATEOFFSET to ensure they are created correctly.

HP built MPE to an extraordinary level of durability. Not even Unix, which relies on the time() function, is going to be able to handle dates as long as MPE/iX, using the invented-in-HP HPCALENDAR intrinsic. This is a good example of why vendor engineering, beyond industry standards, gives "legacy" platforms a longer life — sometimes longer than even the vendor estimates.

08:55 PM in Hidden Value, Homesteading, News Outta HP, Web Resources | Permalink

Bookmark and Share

Use our search engine to find 20 years
of HP 3000 news and articles



The comments to this entry are closed.