       IDENTIFICATION DIVISION.
      *I*I*I*I*I*I*I*I*I*I*I*I*

         PROGRAM-ID   .                   MS03-001 .
      ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
      **                                           **
      ** Copyright by :            (c) MS-Software **
      **                           Januar MCMLXXXV **
      **                       All rights reserved **
      **                                           **
      ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
                               
      *E*E*E*E*E*E*E*E*E*E*E*            
       ENVIRONMENT DIVISION.
      *E*E*E*E*E*E*E*E*E*E*E*

       CONFIGURATION SECTION.
       SOURCE-COMPUTER.                     P3500 .
       OBJECT-COMPUTER.                     P3500 .
     
      *D*D*D*D*D*D*D*
       DATA DIVISION.
      *D*D*D*D*D*D*D*

       WORKING-STORAGE SECTION.
       01  GRAFIK-ENTRY.
           03  GRAFIK-BYTES                 PIC 9(04)  COMP-1.
       01  CURSOR-ENTRY.
           03  CURSOR-OFF-1                 PIC 9(05)  COMP-1.
           03  CURSOR-OFF-2                 PIC 9(05)  COMP-1.

       01  TURBO-WATCH.
      *                                   1....2....3....4....5....
           03  TW-0      PIC X(25) VALUE "BKKKCJ   JJ   JJ   JAKKKD".
           03  TW-1      PIC X(25) VALUE "   N    J    J    J    O ".
           03  TW-2      PIC X(25) VALUE "BKKKC    J    JBKKKDEKKKK".
           03  TW-3      PIC X(25) VALUE "BKKKC    J  KKL    JAKKKD".
           03  TW-4      PIC X(25) VALUE "N   NJ   JEKKKL    J    O".
           03  TW-5      PIC X(25) VALUE "FKKKKJ    EKKKC    JAKKKD".
           03  TW-6      PIC X(25) VALUE "BKKKCJ    MKKKCJ   JAKKKD".
           03  TW-7      PIC X(25) VALUE "KKKKG    J    J    J    O".
           03  TW-8      PIC X(25) VALUE "BKKKCJ   JMKKKLJ   JAKKKD".
           03  TW-9      PIC X(25) VALUE "BKKKCJ   JAKKKL    J KKKD".
      *                                   1....2....3....4....5....

       01  RED-TURBO-WATCH REDEFINES TURBO-WATCH.
           03  RED-TURBO-CHARACTER          OCCURS 10 INDEXED BY IX1.
               05  RED-TURBO-DIGIT          PIC X(05)
                                            OCCURS  5 INDEXED BY IX2.
       01  TIME-GROUP-WOR.
           03  TIME-WOR                     PIC 9(08).
           03  TIME-RED REDEFINES TIME-WOR  PIC 9(01)
                                            OCCURS  8 INDEXED BY IX4.
           03  TIME-GROUP-A-WOR.
               05  TIME-A-WOR               PIC 9(08).
           03  TIME-A-RED REDEFINES TIME-GROUP-A-WOR
                                            PIC 9(01)
                                            OCCURS  8 INDEXED BY IX5.
       01  MONATS-NAMEN.
           03  MON-TAB-WOR                  PIC X(36)
               VALUE "JanFebM{rAprMaiJunJulAugSepOktNovDez".
           03  MON-TAB-RED REDEFINES MON-TAB-WOR
                                            PIC X(03)
                                            OCCURS 12 INDEXED BY IX6.
       01  DATE-WOR.
           03  DATE-JJ                      PIC 9(02).
           03  DATE-MM                      PIC 9(02).
           03  DATE-TT                      PIC 9(02).

       77  WS-LI1                           PIC 9(02).
       77  WS-LI2                           PIC 9(02).
       77  WS-POS                           PIC 9(02).
       77  WS-SIZE                          PIC 9(02).
       77  WS-IX1                           PIC 9(02).
       77  XE-WOR                           PIC 9(01).
       77  XI-WOR                           PIC 9(03)   COMP-3.
       01  XK-WOR.
           03  XK1                          PIC 9(01)   VALUE ZERO.
           03  XK2                          PIC 9(01)   VALUE ZERO.
       01  XL-WOR REDEFINES XK-WOR          PIC 9(02).
       77  XM-WOR                           PIC 9(02)   VALUE ZERO
                                                        COMP-3.
       77  XN-WOR                           PIC 9(01).
       01  A1                               PIC 9(08).
       01  A1-RED REDEFINES A1.
           02 A1-HH                         PIC XX.
           02 A1-MM                         PIC XX.
           02 A1-SS                         PIC XX.
           02 FILLER                        PIC XX.   
       01  SCR-ON.
           05 O-1                           PIC 99 COMP-6.
           05 O-2                           PIC X VALUE "$".
       01  SCR-OFF.
           05 OF-1                          PIC 99 COMP-6.
           05 OF-2                          PIC X VALUE "%".
       01  STRICH                           PIC X(80).
       01 DATUM.
          05 DAT-JJ                     PIC 99.
          05 DAT-MM                     PIC 99.
          05 DAT-TT                     PIC 99.
       01 ZEIT.
          05 ZEIT-SS                    PIC 99.
          05 ZEIT-MM                    PIC 99.
          05 FILLER                     PIC 9(4).
       01 BILD-DATUM.
          05 B-DAT-TT                   PIC 99.
          05 FILLER                     PIC X VALUE ".".
          05 B-DAT-MM                   PIC 99.
          05 FILLER                     PIC X VALUE ".".
          05 B-DAT-JJ                   PIC 99.
       01 BILD-ZEIT.
          05 B-ZEIT-SS                  PIC 99.
          05 FILLER                     PIC X VALUE ":".
          05 B-ZEIT-MM                  PIC 99.
       01 WARTEN                        PIC X.
      /P*P*P*P*P*P*P*P*P*P*
       PROCEDURE DIVISION.
      *P*P*P*P*P*P*P*P*P*P*

       TIME-TERMINATOR SECTION.
       T--BEG.
           DISPLAY "Stopzeit eingeben : HHMMSS00".
           ACCEPT A1.
           DISPLAY SPACE ERASE.
           MOVE "AK"     TO O-1 OF-1.
           MOVE     6958 TO CURSOR-OFF-1.
           MOVE    12288 TO CURSOR-OFF-2.
           DISPLAY CURSOR-ENTRY LINE 1.
           MOVE    "0*******" TO TIME-GROUP-A-WOR.
           PERFORM BACKGROUND.
           DISPLAY SCR-OFF.
           MOVE ALL "-" TO STRICH.
           ACCEPT DATUM FROM DATE.
           ACCEPT ZEIT  FROM TIME.
      *    DISPLAY "EINE ZEIT- UND DATUMSANZEIGE MITTELS RM/COBOL"
      *             LINE 2 POSITION 1 REVERSE.
           DISPLAY "" LINE 2 POSITION 1 REVERSE 
                   "Stopzeit ist um: " A1-HH ":" A1-MM ":" A1-SS 
                    .
           DISPLAY "Datum:"
                    LINE 2 POSITION 52.
           MOVE DAT-JJ TO B-DAT-JJ.
           MOVE DAT-MM TO B-DAT-MM.
           MOVE DAT-TT TO B-DAT-TT.
           DISPLAY  BILD-DATUM 
                    LINE 2 POSITION 59.
           DISPLAY "Zeit:"
                    LINE 2 POSITION 70.
           MOVE ZEIT-SS TO B-ZEIT-SS.
           MOVE ZEIT-MM TO B-ZEIT-MM.
           DISPLAY  BILD-ZEIT
                    LINE 2 POSITION 76.
           DISPLAY STRICH LINE 4  LOW.
           DISPLAY STRICH LINE 22 LOW.
           DISPLAY "Programmende = " LINE 23 LOW.
           DISPLAY "CTRL C" LINE 23 POSITION 16 REVERSE LOW.
           DISPLAY SCR-ON.
       T--1.
           ACCEPT  TIME-WOR FROM TIME.
           IF      TIME-WOR GREATER A1
                   MOVE    6949 TO GRAFIK-BYTES
                   DISPLAY GRAFIK-ENTRY LINE 1
                   PERFORM FEIERABEND
                   MOVE    6949 TO GRAFIK-BYTES
                   DISPLAY GRAFIK-ENTRY LINE 1
                   STOP    RUN
                   .
           MOVE    ZERO TO XE-WOR.
           MOVE    9 TO WS-LI1.
           SET     IX2 TO ZERO.
       T--2.
           IF TIME-RED (3) EQUAL ZERO AND TIME-RED (4) EQUAL ZERO AND
              TIME-RED (5) EQUAL ZERO AND TIME-RED (6) EQUAL ZERO
              MOVE ZERO TO XM-WOR
              MOVE TIME-RED (1) TO XK1
              MOVE TIME-RED (2) TO XK2
              .
           IF TIME-RED (6) EQUAL TIME-A-RED (6)
              MOVE 1 TO XN-WOR
           ELSE
              MOVE ZERO TO XN-WOR.
           SET     IX2 UP BY 1.
           IF      IX2 EQUAL 6
                   IF      XM-WOR NOT EQUAL XL-WOR
                           IF      XN-WOR EQUAL ZERO
                                   DISPLAY SPACE LINE 24 BEEP
                                   ADD     1 TO XM-WOR
                                   MOVE    TIME-WOR TO TIME-GROUP-A-WOR
                                   GO      T--1
                           ELSE
                                   MOVE    TIME-WOR TO TIME-GROUP-A-WOR
                                   GO      T--1
                   ELSE
                           MOVE    ZERO TO XM-WOR  XK1  XK2
                           MOVE    TIME-WOR TO TIME-GROUP-A-WOR
                           GO      T--1
                   .
           ADD     1 TO WS-LI1.
           MOVE    14 TO WS-POS.
           SET     IX4 TO ZERO.
       T--3.
           SET     IX4 UP BY 1.
           IF      IX4 EQUAL 7
                   GO      T--2
                   .
           SET     IX5 TO IX4.
           IF      TIME-RED (IX4) EQUAL TIME-A-RED (IX5)
                   IF      IX4 EQUAL 1 OR IX4 EQUAL 3 OR IX4 EQUAL 5
                           ADD     7 TO WS-POS
                           GO      T--3
                   ELSE
                           ADD     12 TO WS-POS
                           GO      T--3
                   .
           COMPUTE WS-IX1 = TIME-RED (IX4) + 1.
           SET     IX1 TO WS-IX1.
           ADD     1 TO WS-POS.
           IF      XE-WOR NOT EQUAL ZERO
                   GO     T--4.
           IF      IX4 = 1
                   MOVE   50 TO WS-SIZE.
           IF      IX4 = 2
                   MOVE   43 TO WS-SIZE.
           IF      IX4 = 3
                   MOVE   31 TO WS-SIZE.
           IF      IX4 = 4
                   MOVE   24 TO WS-SIZE.
           IF      IX4 = 5
                   MOVE   12 TO WS-SIZE.
           IF      IX4 = 6
                   MOVE    5 TO WS-SIZE.
           PERFORM SC-ERASE.
       T--4.
           DISPLAY RED-TURBO-DIGIT (IX1  IX2) 
                   LINE WS-LI1 POSITION WS-POS.
           ADD     4 TO WS-POS.
           IF      IX4 EQUAL 2  OR  IX4 EQUAL 4
                   ADD     3 TO WS-POS
                   IF      WS-LI1 EQUAL 11 OR WS-LI1 EQUAL 13
                           PERFORM DOPPELPUNKT
                           ADD     3 TO WS-POS
                           GO      T--3
                   ELSE
                           ADD     4 TO WS-POS
                           GO      T--3
            ELSE
                   ADD     2 TO WS-POS
                   GO      T--3
           .
      /
       DOPPELPUNKT SECTION.
       DOP-BEG.
           ADD     1 TO WS-POS.
           DISPLAY "X" LINE WS-LI1 POSITION WS-POS LOW BLINK.
       DOP-END.
           EXIT.
      *
       SC-ERASE SECTION.
       SC-BEG.
           MOVE    WS-LI1 TO WS-LI2.
       SC-1.
           DISPLAY SPACE LINE WS-LI2 POSITION WS-POS SIZE WS-SIZE.
           IF      WS-LI2 EQUAL 14
                   MOVE    1 TO XE-WOR
                   GO      SC-END
                   .
           ADD     1 TO WS-LI2.
           GO      SC-1.
       SC-END.
           EXIT.
      *
       BACKGROUND SECTION.
       BAC-BEG.
           DISPLAY SPACE ERASE.
           ACCEPT  DATE-WOR FROM DATE.
           SET     IX6 TO DATE-MM.
           DISPLAY DATE-TT             LINE 16 POSITION 34 REVERSE.
           DISPLAY ". "                LINE 16 POSITION 36 REVERSE.
           DISPLAY MON-TAB-RED (IX6)   LINE 16 POSITION 38 REVERSE.
           DISPLAY " 19"               LINE 16 POSITION 41 REVERSE.           
           DISPLAY DATE-JJ             LINE 16 POSITION 44 REVERSE.
           MOVE    6948 TO GRAFIK-BYTES.
           DISPLAY GRAFIK-ENTRY LINE 1.
           DISPLAY "B"                 LINE  8 POSITION 13 LOW.
           DISPLAY ALL "K" SIZE 54     LINE  8 POSITION 14 LOW.
           DISPLAY "C"                 LINE  8 POSITION 68 LOW.
           MOVE    8 TO WS-LI2.
       BAC-1.
           ADD     1 TO WS-LI2.
           DISPLAY "J"                 LINE  WS-LI2 POSITION 13 LOW.
           DISPLAY "J"                 LINE  WS-LI2 POSITION 68 LOW.
           IF      WS-LI2 NOT EQUAL 17
                   GO     BAC-1
                   .
           DISPLAY "A"                 LINE 18 POSITION 13 LOW.
           DISPLAY ALL "K" SIZE 54     LINE 18 POSITION 14 LOW.
           DISPLAY "D"                 LINE 18 POSITION 68 LOW.
       BAC-END.
           EXIT.
      /
       FEIERABEND SECTION.
       F-BEG.
           MOVE    ZERO TO WS-LI2 XI-WOR.
       F-1.
           ADD     1 TO WS-LI2.
           MOVE    1 TO WS-POS.
       F-2.
           IF      WS-LI2 EQUAL 25
                   MOVE   24 TO WS-LI2
                   .
           DISPLAY "Feierabend" LINE WS-LI2 POSITION WS-POS REVERSE.
           ADD     10 TO WS-POS.
           ADD     1 TO XI-WOR.
           IF      WS-POS GREATER 80
                   IF     XI-WOR EQUAL 320
                          GO      F-5
                   ELSE
                          ADD     1 TO WS-LI2
                          MOVE    1 TO WS-POS
                   .
       F-3.
           IF      WS-LI2 EQUAL 25
                   MOVE   24 TO WS-LI2
                   .
           DISPLAY "Feierabend" LINE WS-LI2 POSITION WS-POS REVERSE LOW.
           ADD     10 TO WS-POS.
           ADD     1 TO XI-WOR.
           IF      WS-POS GREATER 80
                   IF     XI-WOR EQUAL 320
                          GO      F-5
                   ELSE
                          ADD     1 TO WS-LI2
                          MOVE    1 TO WS-POS
                   .
       F-4.
           IF      WS-LI2 EQUAL 25
                   MOVE   24 TO WS-LI2
                   .
           DISPLAY "Feierabend" LINE WS-LI2 POSITION WS-POS BLINK BEEP.
           ADD     10 TO WS-POS.
           ADD     1 TO XI-WOR.
           IF      WS-POS GREATER 80
                   IF     XI-WOR EQUAL 320
                          GO      F-5
                   ELSE
                          GO      F-1
                   .
           GO      F-2.
       F-5.
           DISPLAY SPACE ERASE.
           MOVE    6948 TO GRAFIK-BYTES.
           DISPLAY GRAFIK-ENTRY LINE 1.
           DISPLAY "  8####d      8####d             5    j     8####d  
      -            "   }    ~     7#####   " LINE  7 POSITION 3.
           DISPLAY "  5           5    j             5    j     5    j  
      -            "   5i  6j     5        " LINE  8 POSITION 3.
           DISPLAY "  5 ,,,l      5    j             =,,,,n     5    j  
      -            "   5 i6 j     =,,n     " LINE  9 POSITION 3.
           DISPLAY "  5    j      5    j             5    j     5    j  
      -            "   5    j     5        " LINE 10 POSITION 3.
           DISPLAY "  )pppp&      )pppp&             5    j     )pppp&  
      -            "   5    j     uppppp   " LINE 11 POSITION 3.
           DISPLAY ALL "p" SIZE 70           LINE 12 POSITION 5 LOW.
       F-6.
       F-END.
           EXIT.
       
