I was just running some tests for a friend of mine and ran across the
strangest thing. In COBOL you can return the date making use of the value
in the TZ variable by saying MOVE FUNCTION CURRENT-DATE TO
FULL-CURRENT-DATE
where FULL-CURRENT-DATE is defined as
01 FULL-CURRENT-DATE.
03 F-DATE.
05 F-YEAR PIC 9(4).
05 F-MONTH PIC 99.
05 F-DAY PIC 99.
03 F-TIME.
05 C-HOUR PIC 99.
05 C-MINUTES PIC 99.
05 C-SECONDS PIC 99.
05 C-SEC-HUND PIC 99.
03 C-TIME-DIFF.
05 C-GMT-DIR PIC X.
05 C-HOUR PIC 99.
05 C-MINUTES PIC 99.
The issue comes up with the C-TIME-DIFF segment, this displays the actual
offset and if it is + or -. If you have a program loop and change the
value of TZ within the program, everything will come back correctly
*except* for C-TIME-DIFF which will always contain the value from when the
program started. If you exit and run again, then C-TIME-DIFF will have the
correct value.
This would seem to be a bug. I'm wondering if anyone knows anything about it.
Regards,
Shawn Gordon
President
theKompany.com
www.thekompany.com
949-713-3276