In the case of Y2K, the problem was often that people defined a date filed as three values all declared as PIC 99 (i.e. a two-digit number). If they migrated to 4 digits, we're fine until Y10K. If they added a window (values less n are 19xx, etc.) or switched to Unix timestamps or a SQL database – there are products which let a COBOL runtime transparently map the indexed file semantics to SQL statements – then it requires more information to say whether it's at risk.
02 ITM-LAST-CHG-DATE.
03 ITM-LC-DATE-CC PIC 99.
03 ITM-LC-DATE-YY PIC 99.
03 ITM-LC-DATE-MM PIC 99.
03 ITM-LC-DATE-DD PIC 99.
I assume this split between 'CC' and 'YY' is a relic of the Y2K updates, so they could add in a whole new field with a default of '19'. +---------------------------------------------+
| TIMESTAMPDIFF(YEAR,CURDATE(), "2050-01-01") |
+---------------------------------------------+
| 33 |
+---------------------------------------------+
Seems to work fineThe ext4 filesystem in Linux, for example, uses epoch time. I think they have it all fixed now, but there were bugs still out there as recently as this year: https://bugzilla.kernel.org/show_bug.cgi?id=23732
The point is: What do they do? There are plenty that will use... Unix timestamps (or worse). Or use those as the lowest common denominator for interchange. There are more systems at play than the data layer, and all of them will take every opportunity to bite you in the arse.
One of the top results for "convert date to integer". People who have an integer on one hand, a datetime on the other are going to see this code and use it (hey, it works) without understanding the ramifications.
I suppose one can only hope that such code is brittle enough that other problems bring it down before 2038.