Strategies for Solving the Y2K Problem

by William Gothard and Les Godner



Listing One

01  BILLCOM-RECORD.

    05  B-EFF-DATE.

        10  B-EFF-YY      PIC  9(02)      VALUE 0.                 

    05  B-CONV-DATE.                                                  

        10  B-CONV-YY     PIC  9(02)      VALUE 0.

    05  FILLER            PIC  9(96). 



Listing Two

01  BILLCOM-RECORD.

    05  B-EFF-DATE.

        10  B-EFF-YY      PIC  9(04)      VALUE 0.                 

    05  B-CONV-DATE.                                                  

        10  B-CONV-YY     PIC  9(04)      VALUE 0.

    05  FILLER           PIC  9(96).





Listing Three 

WORKING STORAGE SECTION.

     

01  POLICY-START-DATE.

    05  POLICY-START-DATE-YY    PIC 9(02) VALUE ZEROS.

    05  POLICY-START-DATE-MM    PIC 9(02) VALUE ZEROS.

    05  POLICY-START-DATE-DD    PIC 9(02) VALUE ZEROS.

        

01  WS-CONVERT-DATE.

    05  WS-CENTURY          PIC 9(02) VALUE ZEROS.         

    05  WS-CONVERT-YY           PIC 9(02) VALUE ZEROS.

    05  WS-CONVERT-MM           PIC 9(02) VALUE ZEROS.

    05  WS-CONVERT-DD          PIC 9(02) VALUE ZEROS.



01  WS-PIVOT-DATE.

    05  WS-PIVOT-YY         PIC 9(02) VALUE 30.



PROCEDURE DIVISION.



MOVE POLICY-START-DATE-YY TO WS-CONVERT-DATE-YY

MOVE POLICY-START-DATE-MM TO WS-CONVERT-DATE-MM

MOVE POLICY-START-DATE-DD TO WS-CONVERT-DATE-DD 

PERFORM VALIDATE-DATE-ROUTINE

   EVALUATE TRUE

       WHEN WINDOW-YES    

           IF WS-CONVERT-YY  IS GREATER THAN  OR EQUAL TO 

                 WS-PIVOT-YY

               MOVE '19'          TO  WS-CENTURY                       

           ELSE                                                            

               MOVE '20'          TO  WS-CENTURY                       

           END-IF

   END-EVALUATE

END-PERFORM.





Listing Four

VALIDATE-DATE-ROUTINE. (Performed by the Windowing routine)

EVALUATE TRUE

   WHEN  WS-VALIDATE-DATE EQUAL ZEROS-YYMMDD

        MOVE ZEROS-CC TO WS-VALIDATE-DATE-CENTURY

        SET WINDOW-INDICATOR TO FALSE

   WHEN WS-VALIDATE-DATE EQUAL NINES-YYMMDD

        MOVE NINES-CC TO WS-VALIDATE-DATE-CENTURY

        SET WINDOW-INDICATOR TO FALSE

END-EVALUATE.





Listing Five

01 WS-DATE.

    05 WS-YY PIC XX.

    05 WS-MM PIC XX.

    05 WS-DD PIC XX.

01 WS-Y2K.

    05 WW-YY-Y2K PIC X(4).

IF WS-YY < 75

        PERFORM 1000-PRT-RTN.





Listing Six

******IF WS-YY < 75

    If WS-YY-Y2K < 1975         

    PERFORM 1000-PRT-RTN.





Listing Seven

*****************************************************************

* ORIGINAL LINE OF CODE:

*      IF B-CLM-STUS-CD = 'O' AND CLM-CLG-REOP-DT-HD (STATS)

*            < TRN-ISS-DT-DRCO NEXT SENTENCE ELSE

*** Y2K START ***

        IF B-CLM-STUS-CD = 'O'

           MOVE CLM-CLG-REOP-DT-HD (STATS) TO WS-JULIAN-WORK-DT-Y2K

           PERFORM JULIAN-DATE-RTN-Y2K THRU JULIAN-DATE-RTN-Y2K-EXIT

           MOVE WS-JULIAN-WORK-DT-Y2K TO CLM-CLG-REOP-DT-HD-Y2K

           MOVE TRN-ISS-DT-DRCO TO WS-JULIAN-WORK-DT-Y2K

           PERFORM JULIAN-DATE-RTN-Y2K THRU JULIAN-DATE-RTN-Y2K-EXIT

           MOVE WS-JULIAN-WORK-DT-Y2K TO TRN-ISS-DT-DRCO-Y2K. 

          * note the period

       IF B-CLM-STUS-CD = 'O' AND CLM-CLG-REOP-DT-HD-Y2K

< TRN-ISS-DT-DRCO-Y2K NEXT SENTENCE ELSE

*** Y2K END ***





3



