STL Time Machine Report #30 - Friday 25 September 1998 (1998-09-25) It seems like they're having some setup problems in Group Four, now that they're cloning more instances of production JCL and generating the usual typos. The programs are already compliant, but the new test JCL is being debugged. Some test cases have been missed, which means that they'll have to be caught on the next iteration. Another problem that is cropping up is tapes. A lot of GDG's are created for a single date cycle test iteration. For the non-MVS geeks, GDG = Generation Data Groups, which is a versioning system for MVS files. If I want to read the current generation of MY.FILE, I ask for MY.FILE(0). If I want to read yesterday's file, I ask for MY.FILE(-1). The new version I create is named MY.FILE(+1) until the job completes and the catalog is updated. They need to scratch most of these GDG's between test iterations, but they also need to preserve some with test results. The problem is that we're moving backwards and forwards in time, so that the tapes to be scratched become difficult to distinguish from one iteration to the next. The increase in the total number of test jobs is also eating into our pool of scratch tapes. You might check out "Year 2000 Solutions for Dummies" which I browsed this weekend in Barnes & Noble. It actually mentions COBOL, and Hourglass, and Tic-Toc. It's not bad for twenty bucks, if you can stand the embarrassment of reading a dummies book. Why can't I find an "OS/390 High Level Assembler for Dummies" book? Or even "MASM for Dummies"? Uh-oh, Handwaver Alert As an SME (Subject-matter Expert), I have made two presentations this year on my primary application. The first one was late last June, for operations and production control. I only had about eight people in the audience, but it was videotaped for the third shift operators. I saw the tape. Gaack! My name is Arnold and I am a handwaver. Have I really gained that much weight since High School? I found my presentation pretty disjointed, as I wandered from subject to subject. I wanted to interrupt and correct that clueless twit on the screen. My boss seemed to think it was pretty good, but all I saw were the places where it fell short. And the whiteboard was basically invisible on the TV screen. Last week I gave a similar presentation to about 30 Unix programmers. This one was tailored for their point of view, since they interface with this application, and they have to test with it. This time I used transparencies, even though the administrative assistant begged me to use Microsoft PowerPoint. No way! I've seen too many PowerPoint presentations where the large monitor wouldn't work, or the laptop wouldn't advance. And I get bored to tears when the speaker simply reads back the same three bullets off the screen that I can read for myself. So I'm pointing with my arm at the big diagram projected on the wall (waving my hands again). This CICS TOR (Terminal-owning region) connects to that CICS AOR (Application-Owning Region) via MRO Links. The third-party database is another region connected this way. The data comes in here, the VSAM file I/O is over here, and by the way this application was made Y2K compliant in September 1997, Time Machine tested last January, and upgraded to CICS 4.1 in August. So The whole system has been compliant for a month now. Let's try to keep it that way. It went pretty well, and I had lots of good questions. One guy asked what we would do for the Millennium Rollover itself. I said we expected to be replaced by Unix and right-sized (big laugh all around). Date Routines - Part II. DocDwarf recently posted a humorous story about some erroneous code in a program he fixed for Y2K. Simplifying a little bit, this code was trying to build the date for the last day of a particular month: IF WS-YRMO = 4 OR 6 OR 9 OR 11 MOVE 30 TO DD ELSE IF WS-YRMO = 2 MOVE 28 TO DD ELSE MOVE 31 TO DD. The humor involved was that WS-YRMO contains a four-digit number in the format YYMM. This meant that every month had an ending date of 31. This kind of thing is better done with a table, I think. Coerce the month into a subscript, and then extract the number of days in a month from the table. MOVE DAYS-IN-MONTH(MM) TO DD. It's a little more work to fix up February in leap years, but at least generating February 28th is better than generating February 31st. Last week I briefly mentioned how to determine the day of week. Here's a method I've used, with 1998-09-13 as an example. All these steps can be performed with integer arithmetic in COBOL: First, convert 1998-09-13 to IBM julian format as 1998/256 (see the last Time Machine report for one method to do that). Next, subtract 1 from 1998, giving 1997. We do this because we want to bias our calendar to a starting date of Monday, 0001-01-01. Divide 1997 by 400 giving NBR-OF-400-YEAR-INTERVALS and REMAINDER-1. Divide REMAINDER-1 by 100 giving NBR-OF-100-YEAR-INTERVALS and REMAINDER-2. Divide REMAINDER-2 by 4, giving NBR-OF-4-YEAR-INTERVALS and a remainder of NBR-OF-1-YEAR-INTERVALS. COMPUTER ABSOLUTE-DAY-COUNT = (NBR-OF-400-YEAR-INTERVALS * 146,097 days) + (NBR-OF-100-YEAR-INTERVALS * 36,524 days) + (NBR-OF-4-YEAR-INTERVALS * 1,461 days) + (NBR-OF-1-YEAR-INTERVALS * 365 days) + JULIAN-DDD. Using our example of 1998-09-13 (1998/256) we get: (4 * 146,097) + (3 * 36,524) + (24 * 1,461) + (1 * 365) + 256 =OR= 584,388 + 109,572 + 35,064 + 365 + 256 = 729,645 days. Divide 729,645 by 7 and the remainder is 0, which is a Sunday. SUN=0, MON=1, TUE=2, WED=3, THU=4, FRI=5, SAT=6. An absolute day count is useful for date difference and date generation arithmetic, in addition to day-of-week calculations. I don't claim this method is efficient, but with proper testing you can generate correct results. The real problem is that given a date of 730,120 days, how do you go backwards to convert to a YYYY-DDD or YYYY-MM-DD date? It's much trickier than you might think, especially when you get a remainder of zero. Your best bet is to get COBOL for MVS and VM, and use the COBOL intrinsic date functions or the LE/MVS library routines. In the last Time Machine report I mentioned Zeller's Congruence. If you need a routine like that in COBOL, here's a link where you can download it: http://www.etk.com/download/etkpak/etkpak.htm#CALRPK I've posted this link on my web page, and thanks to Leif Svalgaard for his kind permission. As of 1998-09-25, My countdown now reads: 37 days until 1998-11-01 (External Customer Test Beta begins) 98 days until 1999-01-01 (External Customer Testing begins) 463 days until 2000-01-01 (Rollover) Previous Year 2000 Time Machine Reports are available at: http://home.att.net/~arnold.trembley/tmr.htm STANDARD DISCLAIMER: I am NOT an official corporate spokesperson. My opinions should not be held against my benevolent employer. -- Arnold Trembley http://home.att.net/~arnold.trembley/ "Y2K? Because Centuries Happen!"