RESOLUTION
To resolve this issue, modify the source code and recompile the Rexx.exe script engine to handle year 2000 and later dates.
The Rexx.exe source code is included in the Microsoft Windows NT Resource Kit CD-ROM in the \Source\Gnu\Rexx folder.
For example, here is one way you can correct the source code:
The problems are in the
std_date() function found in the source file builtin.c.
The code uses two characters for the year portion of the date, and stores it in the tmdata structure by the
localtime() function. However, this is incorrect. For example:
case 'O':
retval = Malloc(9+STRHEAD) ;
sprintf(retval, fmt, tmdata->tm_year, tmdata->tm_mon+1,
tmdata->tm_mday);
If you change the code above to the following code, the return is 00/01/10 for today's date:
case 'O':
retval = Malloc(9+STRHEAD) ;
sprintf(retval, fmt, tmdata->tm_year-100, tmdata->tm_mon+1,
tmdata->tm_mday);
To potentially work around this problem:
- Modify a Rexx script to accommodate this behavior. Here is a scripting example that does so.
say 'Modified output for date(o) function'
x = date('o')
y = translate(x,' ','/')
year = word(y,1)
month = word(y,2)
day = word(y,3)
x = year-100'/'month'/'day
say x
- Use one of the Rexx date options that correctly return the date, such as 'S'.
- Omit the use of the year portion of the date in your script.
- Rewrite your scripts using Windows Scripting Host (WSH).