Is there any way of converting a date (yyyymmdd) into an Absolute Date, I work for a bank and we use an absolute date in quite a lot of programs, but just wondered if there was any way of converting it in sort or icetool ?
We define the absolute date as the number of days since 1st Jan 1900
An eight-position field with a leading sign is created as the result of DATEDIFF. The + indicates that the second field is larger (- would indicate the opposite). Offset by three to get your desired result (23,5,CH for instance).
You need to temporarily "extend" each record to contain the base date, and the resultant difference. You can abut the fields, I've just left padding to more easily read the output.
For a fixed-length record, you extend after the end of the record. For a variable-length record extend at the beginning, using BUILD:
You have to return the data to its original size after using the DATEDIFF (can be in OUTREC or OUTFIL).