Code Place

DT2B2DT 

Apr 22, 2016 05:02 AM

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

Attachment(s)
txt file
DT2B2DT.txt   863 B   1 version
Uploaded - Jun 05, 2020

Related Entries and Links

No Related Resource entered.