PHDate is a date format used by Cognos' PowerHouse 4GL tools. It is a 2-byte integer field, of which the first 7 bits store the year (values 0-99), the next 4 bits store the month, and the last 5 bits store the day. Suprtool has supported this date format for many years.
The problem is, PHDate is not Y2K compliant.
So in the latest versions of PowerHouse (version 8.19 on MPE/iX) Cognos has extended PHDates to optionally store up to the maximum value in those first seven bits, namely ranging from 0 to 127. This new option can be "activated" in one of two ways:
In PDL, specifying "Date size 8" for the ELEMENT or USAGE
In defined or temporary items, specifying "PHDATE Century Included"
The default remains at the old format (year range 0-99).
Suprtool works with PHDates in two ways:
When creating a constant for selection comparisons:
>item inv-date,date,phdate >if inv-date = $today
When converting PHDate fields into yyyymmdd formats:
>extract new-date = $STDDATE(inv-date)
In both cases, Suprtool needs to "know" whether the field is an old- or new- format PHDate. For example (assuming the system date is in the year 2001),
Should $today resolve the year to 01 or 101?
When converting PHDates to yyyymmdd format via the STDdate function, should the Set Date Cutoff value be applied to determine the century component of the new date? In other words, if Suprtool has a date cutoff set at 20, and finds a PHDate with a year value of 15, should it assume that it should pre-pend a 19 or a 20?
So here's what we've done in the latest pre-release of Suprtool:
PHDate in the Item command by default will still mean the "old" PHDate date format (year values 0 - 99).
A new date type has been added to support "century included" PHDates (year values 0 - 127).
>item mydate,date,phdate8
A new Set command will map all PHDate syntax in the Item command to then use phdate8 as the item type.
>set date MapToPhdate8 on
This way we have backward compatibility, but with minimum impact on those customers who have PowerHouse version 8.19 and have chosen to enable the new PowerHouse date format. This feature is available in Suprtool pre-release version 4.2.52.
[Hans Hendriks]