Working with Century-included PHDATEs

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:

The default remains at the old format (year range 0-99).

Suprtool works with PHDates in two ways:

  1. When creating a constant for selection comparisons:

    >item inv-date,date,phdate
    >if inv-date = $today
    
  2. 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),

So here's what we've done in the latest pre-release of Suprtool:

  1. PHDate in the Item command by default will still mean the "old" PHDate date format (year values 0 - 99).

  2. A new date type has been added to support "century included" PHDates (year values 0 - 127).

    >item mydate,date,phdate8
    
  3. 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]

....Back to the Suprtool Q&A Page