Year 2000 Issues
Applies to: WG3.x
Editor's note: this chapter is new in the WG3 layer. It is from section 6 ("Year 2000 issues") of the Developer's Addendum for Worldgroup 3.12 (
wg312dev; the earlier 3.10 edition,devad3, is the same text apart from "3.10" for "3.12",BC5forBC50, InstallShield V5.0 for V5.1 and spelling). The addendum has no figures. Prose is unrewritten; "Header check" notes record where the printed text disagrees with the WG3.2 headers. The client-side paragraphs (date entry, date output, date input) are tagged WG1-3.x (Client); see also chapter 20. Related: chapters 8, 9 and 11.
...
The Major BBS Baseline Changes Required For Year 2000 Compliance
The year 2000 issue has at its heart one problem: the use of two digits to represent a year value that requires more than two digits for a complete representation. For example, it is common practice when writing a date to represent 1998 as 98. This practice was also adopted by many computer programs and can cause bugs when the century portion of the year can not be inferred with 100% accuracy or when dates are sorted using a two-digit representation of the year.
What is known as "year 2000 compliance" is defined differently by different organizations. However, all definitions come down to one issue: will the software continue to work correctly after the year 2000? In Worldgroupthe Major BBS, most dates are stored using DOS binary format which is valid until 2108, or VB binary format which is valid until 9999. However, three major areas were identified that were not year 2000 compliant and may affect developers: the birth date field of the user account structure, the date format used by the Audit Trail, and certain date entry functions used by client applications.
User Account Birth Date
The user account birth date (usually referenced through usaptr->birthd) was stored as a string using the U.S. standard month/day/year format, with two digits used to represent the year. This may not have been a
...
(assuming 1900 as the century if the date is in the old format). In addition, all data entry fields used for the birth date have been lengthened to accommodate a four-digit year.
Audit Trail
In previous versions of Worldgroup, Audit Trail information was stored in a Btrieve data file. The time stamp on each entry was stored as a string with a two-digit year. In addition, the time stamp was used as the key for the data file. Thus, when the year 2000 arrived, the Audit Trail would start adding entries to the beginning of the list rather than at the end (after all, "00" is less than "99").
This problem was fixed by creating an entirely new file format. Since Audit Trail information is usually only appended, and random access to the data is usually not a high priority, the Audit Trail is now stored in a binary/text file instead of a Btrieve data file. The exact nature of the new storage format is discussed below and in the Audit Trail API documentation.
Client Application Date Entry
Applies to: WG1-3.x (Client)
Client application date entry (VB masked edit boxes,
Format$(),DateValue()).
Galacticomm's client applications have historically used a masked edit box for date entry. The standard format used for the masked edit box was two digits for the month, two digits for the day, and two digits for the year. The two-digit limitation on years is clearly not in keeping with year 2000 compliance. Since this limitation had to be removed, and since there are standard functions in VB that will recognize any valid date string, all masked edit boxes being used for date entry were replaced with standard text boxes. Users can now enter any valid date and it will be recognized by the clients.
API Changes And Additions
Birth Date Manipulation Functions
Applies to: WG3.x
Header check:
fixBirthdate()andcalcage()are declared inMAJORBBS.H,strBirthdate()returnsconst CHAR *(MAJORBBS.H:975) andokbday()takesCHAR *stg(a buffer that it rewrites to the new format);DATSIZis9(DNTAPI.H:137).
...
The second function is used to convert the birth date string (in either the old or new format) to a version that can be used for displays. The output is the date in U.S. standard format, MM/DD/YYYY.
Date and Time API
To facilitate year 2000 compliance, a number of new functions have been added to the existing date and time API and some existing functions have been modified. These changes fall into three basic categories: changes to support the use of four-digit years, new functions to support a "sort" date format, and new functions to support dates treated as discrete components. Complete details on these functions can be found in the Date and Time API documentation. An overview of the important changes follows.
...
The most flexible binary date format is using a separate integer variable to hold each of the year, month, and day components of a date. This is referred to in the documentation as the "discrete components" format. A suite of functions has been added to manipulate discrete component dates. Most of these functions mirror functions that existed for manipulating DOS packed dates. See the Date and Time API documentation for details.
Audit Trail API
The Audit Trail data file format was changed for Worldgroup 3.12 for two main reasons: to provide year 2000 compliance, and to provide easier access to the Audit Trail data.
Historically, the Audit Trail has been stored in a Btrieve data file. This provided a standard access mechanism, since most data in Worldgroup the Major BBS is stored in Btrieve files, and under the DOS versions of Worldgroupthe Major BBS, this provided a certain amount of data security, since the Btrieve engine has built-in mechanisms to ensure file integrity. The primary down-side of storing any information in a Btrieve file is that the data is difficult for non-Worldgroup the Major BBS products to access the data. In most cases, custom programming is required to read the data from the Btrieve file and convert it to a more generic format that can be read by general-purpose data manipulation utilities.
For Worldgroup 3.1, Audit Trail data is stored in a binary/text file. The file is opened and accessed in binary mode by Worldgroup the Major BBS itself, but the contents of the file are formatted so that it can be treated by outside programs as a fixed-length ASCII data file. See the Audit Trail API documentation for details.
...
Add-ons that read from the Audit Trail will require changes, however. The Audit Trail API provides generic access to Audit Trail files. When reading from the Worldgroup Major BBS Audit Trail, always use the global handle which is opened by the baseline. This handle is declared in MAJORBBS.H and imported through WGSERVER.LIB:
...
There are also functions to find records by date. See the Audit Trail API documentation for details on these functions.
Compliance Guidelines
Handling Birth Date
Online modules that accept birth dates as input should use okbday() to validate the input. The user input should be passed to this function and the modified date string should then be copied into the user account structure.
Modules that read the birth date may need to be able to handle both formats. Modules written only for Worldgroup the Major BBS version 3.12 and later should call fixBirthdate() before using the birth date field, especially if the account record is read directly from the data file. Then the birth date can be decoded using sDateDecode(). Modules that must remain compatible with Worldgroup the Major BBS version 3.0 can use the GCOMM library function alldgs() to determine whether a birth date is in the new format or the old format. For example:
...
if (alldgs(usaptr->birthd)) {
/* it's the new format */
sscanf(usaptr->birthd,"%4d%2d%2d",&year,&month,&day);
}
else {
/* it's the old format */
sscanf(usaptr->birthd,"%d/%d/%d",&month,&day,&year);
}Using the New Audit Trail
Complete details on using the new Audit Trail are given in the above section on API Changes and Additions and in the Audit Trail API documentation. The key points to keep in mind are:
...
- Offline utilities should get the Audit Trail file name from the AUDITFILE define in MAJORBBS.H.
Date Output
On the server, dates that are output for display only and for which the century can be implied with a high degree of accuracy do not strictly need to be changed to use four-digit years. However, you should be aware that some organizations require a complete year in all date displays in order to consider a product "year 2000 compliant".
...
All client-side date output should now be done using the standard VB library function Format$(). In particular, you should change all calls to the Galacticomm function mebdate() to use Format$() instead. In addition to the existing standard date format strings defined in GCSPCLI.BAS (DATEFMT, MDATEFMT, LDATEFMT, and SERVDFMT), two new format strings have been added. The first one, LSRVDFMT, is equivalent to the existing SERVDFMT format. It generates a date string in the format MM/DD/YYYY which can be decoded using dcdate(). The difference between the two is that SERVDFMT generated a string with a two-digit year while LSRVDFMT generates a string with a four-digit year. The second new format string, SORTDFMT, is used to generate a sort format date string (YYYYMMDD).
Date Input
On the server, change the size of date string buffers to LDATSIZ instead of DATSIZ. For FSD templates, increase the length of date entry fields from eight to ten. You can still use dcdate() for decoding date strings to DOS packed format or you can use the new dateDecode() function to decode to discrete components.
...