"Database Developer"
by Ken North
Web Techniques, October 1998

Web Techniques grants permission to use these listings (and code) for 
private or commercial use provided that credit to Web Techniques and the 
author is maintained within the comments of the source. For questions, 
contact editors@web-techniques.com. 


[LISTING ONE]

/* C Type Definition for dBASE III and IV Headers */
/*(Vintage 1989, Not Y2K-compliant)               */

typedef struct 
    {
    char      id,              /* identification              */
              yy, mm, dd;      /* date stamp                  */
    long      nrecs;           /* total records in file       */
    unsigned  headerlen,       /* count of bytes in header    */
              reclen;          /* number of bytes per record  */

    char      res [2],         /*  RESERVED field 1           */
              incompletexn,    /* incomplete transaction flag */
              encrypted,       /* encrypted file flag         */
              lan [12],        /* RESERVED for LAN version    */
              mdx,             /* .MDX file exists flag       */
              res2 [3];        /* RESERVED field 2            */
    } HEADREC ;




[LISTING TWO]

/* Example COBOL Date Structures (Not Y2K-Compliant) */

01  DATE-HOLDER-MMDDYY. 
   03  WS-MM         PIC X(2).
   03  WS-DD         PIC X(2).
   03  WS-YY         PIC X(2).

01  DATE-HOLDER-YYMMDD. 
   03  WS-YY         PIC X(2).
   03  WS-MM         PIC X(2).
   03  WS-DD         PIC X(2).

01  START-MMDDYY. 
   03  START-MM      PIC 9(2).
   03  START-DD      PIC 9(2).
   03  START-YY      PIC 9(2).

01  START-YYMMDD. 
   03  START-YY      PIC 9(2).
   03  START-MM      PIC 9(2).
   03  START-DD      PIC 9(2).