Topic: Code Place

Subtopic: DB2 for z/OS

DB2 for z/OS UDF that converts a date that resides in 2 bytes into a YYYY-MM-DD date.

The origin of date in 2 bytes is from computing pre-history were every bit was precious.

It goes like that:

year in 7 bits

month in 4 bits

day in 5 bits

if year is < 50 add '20' in front of it

else add '19' in front.

(*) it makes use of two other UDFs - HEX2BIT & BIT2NUM

Click Here to Download

NOTE: These are only open to members of IDUG. If you are not a member, please CLICK HERE for more information.