Computers are efficient. They use the same memory chips for program instructions and for data. And they use the same busses to transfer the instructions and the data to and from memory. In the old days, memory was at a premium, and so one did not waste memory locations. Today, computers may have 130 million memory locations. In the old days, they may have had 250.
So programmers would not want to use 4 memory locations to hold a 4-digit date, when 2 locations would hold a 2-digit one. So we ended up with a lot of 2-digit date fields in programs.
Two-digit date fields are ambiguous The term "03" could mean 1903, or 2003, in the normal business world. And to a computer, it just means "03." It is the program that makes the assumption, just like your old checks and forms, that the numbers "19" should go before the "03." The "19" was printed on the checks and forms, and is embedded in the computer's code. There is no way for the computer to tell the difference.
Thus there are 2 separate problems: program and data. The programs can't tell which is what, and the data on file is not definitive as to what century it belongs to.
Varygood Manufacturing Company has several concerns about possible Y2K problems. Its assembly line is computer controlled. Its inventory control is computer controlled. Its data processing is computer controlled. It has excess computer and data processing personnel capacity, and it contracts with other companies to handle payroll functions.
It was a pioneer in computer applications in all these areas. The programs were written by the grandson of the owner, a bright young man who since became spiritual and lives on a mountain top in Tibet, where he has no cellular phone, no fax, no email, no neighbors except an occasional yak, and no interest in Varygood.
He wrote all the programs in Benton Harbor BASIC, an early version pioneered by the Heath Company, and subsequently converted them to Microsoft BASIC, which were then compiled for speed of use. BASIC is, of course, a rather intuitive language that people write in, which is then interpreted or compiled by other programs into a form that computers can use.
He left all the source code neatly bound in books, except for some changes that he made now and then and no one is sure where they are.
The manufacturing and inventory control programs are integrated, and they use dates in prioritizing jobs, and selecting parts, on a first-in, first-out basis. Management is aware that if the Y2K problem is not handled properly, the year 2000 jobs will appear the oldest, and the 1999 jobs will never get done.
The inventory control program also has a cut-off, that parts older than 90 days are obsolete and are not selected for incorporation in the product. Thus the newest parts (delivered in 2000) will be selected, because the computer thinks they are the oldest, and they will then be rejected as obsolete, because they are 100 years old. And the oldest will never be used, because they will be past their allowable aging by the time production resumes after the shutdown. There may be other problems as well, that have not yet been visualized.
The payroll functions, management also realizes, will count years-of-service improperly, if the Y2K problems are not addressed properly. Vacation entitlements may become astronomical.
And the contracted payroll work will similarly suffer if the problems are not resolved. Varygood cuts the pension checks, and without correction, 100-year employees will be getting checks that bankrupt the client companies.
Counsel has advised that if production halts, there will be liabilities for delay under the forms of contract used by the company. Counsel has also advised that, even though as between the parties, checks that are erroneously cut can be corrected, in the hands of third parties (holders in due course), there may not be a defense, and therefore the company's resources are at risk, and the data processing client contracts may impose liability on Varygood for any losses they suffer.
Insurance agents assure the company that Y2K losses are not covered by their existing policies.
And so Varygood embarks, on December 1, 1999, on the Y2K quest.
For the purposes of our discussion, there are 3 kinds of computer code. Source code is what people write, in some language intelligible to humans and machine-translatable into a language computers can run. Source code may be written in BASIC, COBOL, FORTRAN, RPG, Pascal, ADA, Forth, or some other language. Some more modern programs are written in higher level languages than these. See Listing 1 for an example of BASIC source code.
Machine code is what you get when you run source code through a compiler, which is a program that translates the source code into language the machine can directly understand. See Listing 2 as an example of machine code.
The third kind of code, for our purposes, is assembly language. This is a human-readable version of machine code. It is very low levelvery tedious to work withand operates at the single computer instruction level.
There are programs called disassemblers that take machine code and try to reverse translate it back into what the computer thinks is probably what the humans wrote. Listing 3 is an example of disassembled code.
Now, back at Varygood, the Information Services division discovers the source code left by the Tibetan monk (see Listing 1). It concludes, correctly, that there is a Y2K problem: the program will only input a 20th century date, and assumes all dates entered are 20th century dates. The programmers go through the code (500 pages of it) and revise part of it. Then, they run it, and find that it does not contain all of the features of the programs currently being used by Varygood. Obviously, the programmer did make enhancements to the programs that were not properly documented in the source code books.
Information Services concludes that the source code is not adequate for the Y2K solution, and thus it turns to the machine code that the computers actually run. First, it does a hex dump of the code (quite a large printout: the little program in Listing 1 generates 35,000 characters of code), and duly finds what it thinks are the date routines (Listing 2). Actually, the total output of Varygood's machine code is 5,000 pages of code in total.
Information Services has by this time hired additional personnel, who then disassemble the machine code into assembly language, which can be modified (however tediously) by the programmers. By this time, the code aggregates 50,000 pages. See Listing 3 for what happened to our little BASIC routine.
A look at listing 3 shows that it is not going to be trivial to fix the problem. And that's just one of perhaps 500 date routines in Varygood's code, scattered throughout the 5,000 pages of machine code, now 50,000 pages of disassembled code.
Management and Information Services confer, and decide that it will be better to purchase and modify, or create from scratch, new programs, using more modern and powerful tools. But it is now December 15th. They are, rightly, concerned.
In the real world, there are people, and utility programs, that can use other methods and assumptions which may simplify the solutions to the problems as disclosed in the example here. One method would be, as above, to find the date routines, then allocate more memory to the date function (in another part of the program, where variables are declared), and then change the input language to require 4 digits.
But what do you do with the existing data? There may be megabytes of data that contains 2-digit date fields. How do you convert it? One way is to use "windowing" techniques, which assume that, say, anything prior to XX68 is in the 2000's, and anything after XX67 is in the 1900's. If those assumptions are correct, then the solutions will be valid. More modern code may have less problems. But the problems are real, and urgent. They are most likely to be found in legacy mainframe computer code, because of early constraints on computer memory. They are next likely to be found in minicomputer code, because much of it is derived from mainframe programs. DOS programs that are derived from old FORTRAN or COBOL programs have similar problems. And WIN98 programs running on new computers are least likely to have them.
But you should have someone knowledgeable in computers in general, and Y2K problems in particular, evaluate your particular situation. The point of this exercise is to get your attention. And to wish you good luck.
Vance A. Fisher
May 19, 1999
1 ' This Y2K violation is from a former working personal financial program
2 ' written in 1979.
3 '
100 'This is the date entry routine. Note it assumes a 2-digit year ("82xxxx").
125 INPUT "Year for this session (in form 820000)";CDYR: 'Coded year
130 INPUT "Date for this session ";C2
140 INPUT "Month of data for this session (i.e., JAN)";M$
150 ' Return
160 '
1450 ' This processes the date into normal text. Note the 1900 in 1470.
1460 'DATE ROUTINE (Decodes date in form, 820101)
1470 LET YEAR=INT(C1/10000)+1900
1480 LET MO=INT((C1-CDYR)/100)
1490 LET DA=C1-CDYR-MO*100
1500 DT$=M$(MO) + STR$(DA) + ","+STR$(YEAR)
1510 RETURN
119B:8000 00 FF 9A 0D 0A 72 75 6E-2D 74 69 6D 65 20 65 72 .....run-time er
119B:8010 72 6F 72 20 00 FF FF FF-00 00 00 00 00 00 00 00 ror ............
119B:8020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 A2 00 ................
119B:8030 00 00 4A 01 00 EC 01 B1-26 00 94 00 59 65 61 72 ..J.....&...Year
119B:8040 20 66 6F 72 20 74 68 69-73 20 73 65 73 73 69 6F for this sessio
119B:8050 6E 20 28 69 6E 20 66 6F-72 6D 20 38 32 30 30 30 n (in form 82000
119B:8060 30 29 16 00 BE 00 44 61-74 65 20 66 6F 72 20 74 0)....Date for t
119B:8070 68 69 73 20 73 65 73 73-69 6F 6E 20 2A 00 D8 00 his session *...
119B:8080 4D 6F 6E 74 68 20 6F 66-20 64 61 74 61 20 66 6F Month of data fo
119B:8090 72 20 74 68 69 73 20 73-65 73 73 69 6F 6E 20 28 r this session (
119B:80A0 69 2E 65 2E 2C 20 4A 41-4E 29 00 40 1C 46 00 80 i.e., JAN).@.F..
119B:80B0 ED 44 00 00 C8 42 52 00-09 08 00 00 00 00 01 C0 .D...BR.........
119B:80C0 52 00 04 00 0B 00 00 00-01 00 24 01 2C 95 00 B2 R.........$.,...
119B:80D0 00 0B 00 B0 FF FF 01 03-00 B2 00 09 00 B0 11 01 ................
119B:80E0 00 B2 00 11 00 B0 20 1F-20 1F 07 05 00 B2 04 0E ...... . .......
119B:80F0 00 B0 00 0F 00 B0 04 04-00 00 00 00 20 1F 7A 01 ............ .z.
119B:8000 00FF ADD BH,BH
119B:8002 9A0D0A7275 CALL 7572:0A0D
119B:8007 6E DB 6E
119B:8008 2D7469 SUB AX,6974
119B:800B 6D DB 6D
119B:800C 65 DB 65
119B:800D 206572 AND [DI+72],AH
119B:8010 726F JB 8081
119B:8012 7220 JB 8034
119B:8014 00FF ADD BH,BH
119B:8016 FFFF ??? DI
119B:8018 0000 ADD [BX+SI],AL
119B:801A 0000 ADD [BX+SI],AL
119B:801C 0000 ADD [BX+SI],AL
119B:801E 0000 ADD [BX+SI],AL
119B:8020 0000 ADD [BX+SI],AL
119B:8022 0000 ADD [BX+SI],AL
119B:8024 0000 ADD [BX+SI],AL
119B:8026 0000 ADD [BX+SI],AL
119B:8028 0000 ADD [BX+SI],AL
119B:802A 0000 ADD [BX+SI],AL
119B:802C 0000 ADD [BX+SI],AL
119B:802E A20000 MOV [0000],AL
119B:8031 004A01 ADD [BP+SI+01],CL
119B:8034 00EC ADD AH,CH
119B:8036 01B12600 ADD [BX+DI+0026],SI
119B:803A 94 XCHG SP,AX
119B:803B 005965 ADD [BX+DI+65],BL
119B:803E 61 DB 61
119B:803F 7220 JB 8061
119B:8041 66 DB 66
119B:8042 6F DB 6F
119B:8043 7220 JB 8065
119B:8045 7468 JZ 80AF
119B:8047 69 DB 69
119B:8048 7320 JNB 806A
119B:804A 7365 JNB 80B1
119B:804C 7373 JNB 80C1
119B:804E 69 DB 69
119B:804F 6F DB 6F
119B:8050 6E DB 6E
119B:8051 2028 AND [BX+SI],CH
119B:8053 69 DB 69
119B:8054 6E DB 6E
119B:8055 20666F AND [BP+6F],AH
119B:8058 726D JB 80C7
119B:805A 2038 AND [BX+SI],BH
119B:805C 3230 XOR DH,[BX+SI]
119B:805E 3030 XOR [BX+SI],DH
119B:8060 3029 XOR [BX+DI],CH
119B:8062 16 PUSH SS
119B:8063 00BE0044 ADD [BP+4400],BH
119B:8067 61 DB 61
119B:8068 7465 JZ 80CF
119B:806A 20666F AND [BP+6F],AH
119B:806D 7220 JB 808F
119B:806F 7468 JZ 80D9
119B:8071 69 DB 69
119B:8072 7320 JNB 8094
119B:8074 7365 JNB 80DB
119B:8076 7373 JNB 80EB
119B:8078 69 DB 69
119B:8079 6F DB 6F
119B:807A 6E DB 6E
119B:807B 202A AND [BP+SI],CH
119B:807D 00D8 ADD AL,BL
119B:807F 004D6F ADD [DI+6F],CL
119B:8082 6E DB 6E
119B:8083 7468 JZ 80ED
119B:8085 206F66 AND [BX+66],CH
119B:8088 206461 AND [SI+61],AH
119B:808B 7461 JZ 80EE
119B:808D 20666F AND [BP+6F],AH
119B:8090 7220 JB 80B2
119B:8092 7468 JZ 80FC
119B:8094 69 DB 69
119B:8095 7320 JNB 80B7
119B:8097 7365 JNB 80FE
119B:8099 7373 JNB 810E
119B:809B 69 DB 69
119B:809C 6F DB 6F
119B:809D 6E DB 6E
119B:809E 2028 AND [BX+SI],CH
119B:80A0 69 DB 69
119B:80A1 2E CS:
119B:80A2 65 DB 65
119B:80A3 2E CS:
119B:80A4 2C20 SUB AL,20
119B:80A6 4A DEC DX
119B:80A7 41 INC CX
119B:80A8 4E DEC SI
119B:80A9 2900 SUB [BX+SI],AX
119B:80AB 40 INC AX
119B:80AC 1C46 SBB AL,46
119B:80AE 0080ED44 ADD [BX+SI+44ED],AL
119B:80B2 0000 ADD [BX+SI],AL
119B:80B4 C8 DB C8
119B:80B5 42 INC DX
119B:80B6 52 PUSH DX
119B:80B7 0009 ADD [BX+DI],CL
119B:80B9 0800 OR [BX+SI],AL
119B:80BB 0000 ADD [BX+SI],AL
119B:80BD 0001 ADD [BX+DI],AL
119B:80BF C0 DB C0
119B:80C0 52 PUSH DX
119B:80C1 0004 ADD [SI],AL
119B:80C3 000B ADD [BP+DI],CL
119B:80C5 0000 ADD [BX+SI],AL
119B:80C7 0001 ADD [BX+DI],AL
119B:80C9 0024 ADD [SI],AH
119B:80CB 012C ADD [SI],BP
119B:80CD 95 XCHG BP,AX
119B:80CE 00B2000B ADD [BP+SI+0B00],DH
119B:80D2 00B0FFFF ADD [BX+SI+FFFF],DH
119B:80D6 0103 ADD [BP+DI],AX
119B:80D8 00B20009 ADD [BP+SI+0900],DH
119B:80DC 00B01101 ADD [BX+SI+0111],DH
119B:80E0 00B20011 ADD [BP+SI+1100],DH
119B:80E4 00B0201F ADD [BX+SI+1F20],DH
119B:80E8 201F AND [BX],BL
119B:80EA 07 POP ES
119B:80EB 0500B2 ADD AX,B200
119B:80EE 040E ADD AL,0E
119B:80F0 00B0000F ADD [BX+SI+0F00],DH
119B:80F4 00B00404 ADD [BX+SI+0404],DH
119B:80F8 0000 ADD [BX+SI],AL
119B:80FA 0000 ADD [BX+SI],AL
119B:80FC 201F AND [BX],BL
119B:80FE 7A01 JPE 8101