       IDENTIFICATION DIVISION.
       PROGRAM-ID. IND128.
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       SOURCE-COMPUTER. P3500.
       OBJECT-COMPUTER. P3500.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
       SELECT IDA-I-1 ASSIGN TO RANDOM "A:INDAM.IDA"
               ORGANIZATION IS INDEXED
               ACCESS MODE IS DYNAMIC
               RECORD KEY IS REC-KEY-I-1
               FILE STATUS IS FI-STA-I-1.
       SELECT IDA-O-1 ASSIGN TO RANDOM "A:INDAM.ODA"
               ORGANIZATION IS INDEXED
               ACCESS MODE IS DYNAMIC
               RECORD KEY IS REC-KEY-O-1
               FILE STATUS IS FI-STA-O-1.
       DATA DIVISION.
       FILE SECTION.
       FD  IDA-I-1
           LABEL RECORD IS STANDARD
           BLOCK CONTAINS 1 RECORDS
           RECORD CONTAINS 128 CHARACTERS
           DATA RECORD IS REC-I-1.
       01  REC-I-1.
        03 REC-KEY-I-1.                
         05 KEY-I                      PIC 9(13).
      *
        03 ZEICHEN-TEXT-I-1            PIC X(115).
       FD  IDA-O-1
           LABEL RECORD IS STANDARD
           BLOCK CONTAINS 1 RECORDS
           RECORD CONTAINS 128 CHARACTERS
           DATA RECORD IS REC-O-1.
       01  REC-O-1.
        03 REC-KEY-O-1.                
         05 KEY-O                      PIC 9(13).
      *
        03 ZEICHEN-TEXT.
         05 ZEICHEN-TEXT-O-1           PIC X(10).
         05 ZEICHEN-TEXT-O-2           PIC X(105).
      /
       WORKING-STORAGE SECTION.
       01      REC-KEY.
        03     W-KEY                   PIC 9(13).
       01 TIMER.
        03 HOURS                       PIC 99 USAGE COMP-1 VALUE ZERO.
        03 MINUTES                     PIC 99 USAGE COMP-1 VALUE ZERO.
        03 SECONDS                     PIC 99 USAGE COMP-1 VALUE ZERO.
       01 TIMEX.
        03 STUNDE                      PIC 99.
        03 MINUTE                      PIC 99.
        03 SEKUND                      PIC 99.
       77      FI-STA-I-1              PIC XX.
       77      FI-STA-O-1              PIC XX.
       01      EINGABE-DATEN.
        03     EINGABE.
         05    ZEICHEN-1-3             PIC XXX.
          88   RUN-CODE                VALUE "RUN".
          88   DELETE-CODE             VALUE "DEL".
          88   DISPLAY-CODE            VALUE "DIS".
          88   END-CODE                VALUE "END".
          88   COMMENT-CODE            VALUE "COM".
          88   OPEN-CODE               VALUE "OPE".
          88   CLOSE-CODE              VALUE "CLO".
         05    FILLER                  PIC X(17).
        03     EINGABE-R REDEFINES EINGABE.
         05    ZEICHEN-1               PIC X.
         05    FILLER                  PIC X.
         05    ZEICHEN-3-5             PIC XXX.
          88   START-CODE              VALUE "STA".
          88   STOP-CODE               VALUE "STO".
          88   COUNTER-CODE            VALUE "COU".
          88   TRIGGER-CODE            VALUE "TRI".
          88   WAIT-CODE               VALUE "WAI".
          88   KEY-CODE                VALUE "KEY".
         05    FILLER                  PIC X(15).
        03     EINGABE-R-R REDEFINES EINGABE.
         05    EINGABE-SPALTE          OCCURS 20 TIMES
                                       PIC X.
        03     KOMMENTAR               PIC X(20)         VALUE SPACE.
        03     EINGABE-NUMERISCH.
         05    EINGABE-WERT            PIC 99999         VALUE ZERO.
        03     EINGABE-NUMERISCH-R REDEFINES EINGABE-NUMERISCH.
         05    EINGABE-NU-SP           OCCURS 5 TIMES
                                       INDEXED BY NU-SP
                                       PIC X.
        03     EINGABE-ALPHA.          
         05    EINGABE-ALPHA-WERT      PIC X(13)         VALUE ZERO.
        03     EINGABE-ALPHA-R REDEFINES EINGABE-ALPHA.
         05    EINGABE-AL-SP           OCCURS 13 TIMES
                                       INDEXED BY AL-SP
                                       PIC X.            
        03     SPALTE-MIN              PIC 99    COMP-3  VALUE ZERO.
        03     X-SPALTE                PIC 99    COMP-3  VALUE ZERO.
        03     SPALTE                  PIC 99    COMP-3  VALUE ZERO.
        03     A-F-STRING.
         05    FILLER                  PIC X(6)  VALUE  "ABCDEF".
         05    A-F-STRING-ENDE         PIC X.
        03     ET-CODE                 PIC X         VALUE "^".
      /
       01      DISPLAY-DATEN.
        03     DISPLAY-FELD.
         05    COUNTER-DISPLAY         PIC 9(5)          VALUE ZERO.
         05    TRIGGER-DISPLAY         PIC 9(5)          VALUE ZERO.
         05    WAIT-DISPLAY            PIC 9(5)          VALUE ZERO.
         05    START-DISPLAY           PIC X.
         05    STOP-DISPLAY            PIC X.
         05    KEY-DISPLAY             PIC X(13)         VALUE ZERO.
        03     X-WERT.
         05    X-DISPLAY               PIC X.
         05    FILLER                  PIC X         VALUE IS "^".
        03     X-WERT-R REDEFINES X-WERT.
         05    X-NUMERISCH             PIC 999   COMP-3.
     * 
       01     DATEN-BLOCK.
        03    A-F-DATEN.
         05   A-FELD.
          07  A-COUNTER               PIC 9(5)  COMP-3  VALUE ZERO.
          07  A-MAX                   PIC 9(5)  COMP-3  VALUE ZERO.
          07  A-TRIGGER-COUNTER       PIC 9(5)  COMP-3  VALUE ZERO.
          07  A-TRIGGER-MAX           PIC 9(5)  COMP-3  VALUE ZERO.
          07  A-WAIT-COUNTER          PIC 9(5)  COMP-3  VALUE ZERO.
          07  A-START-MERKER          PIC X            VALUE "N".
           88 A-START                 VALUE "Y".        
          07  A-STOP-MERKER           PIC X            VALUE "N".
           88 A-STOP                  VALUE "Y".
          07  A-KEY                   PIC X(13)         VALUE ZERO.
      *  05   B-FELD.
          07  B-COUNTER               PIC 9(5)  COMP-3  VALUE ZERO.
          07  B-MAX                   PIC 9(5)  COMP-3  VALUE ZERO.
          07  B-TRIGGER-COUNTER       PIC 9(5)  COMP-3  VALUE ZERO.
          07  B-TRIGGER-MAX           PIC 9(5)  COMP-3  VALUE ZERO.
          07  B-WAIT-COUNTER          PIC 9(5)  COMP-3  VALUE ZERO.
          07  B-START-MERKER          PIC X            VALUE "N".
           88 B-START                 VALUE "Y".
          07  B-STOP-MERKER           PIC X            VALUE "N".
           88 B-STOP                  VALUE "Y".
          07  B-KEY                   PIC X(13)         VALUE ZERO.
      *    
         05   C-FELD.
          07  C-COUNTER               PIC 9(5)  COMP-3  VALUE ZERO.
          07  C-MAX                   PIC 9(5)  COMP-3  VALUE ZERO.
          07  C-TRIGGER-COUNTER       PIC 9(5)  COMP-3  VALUE ZERO.
          07  C-TRIGGER-MAX           PIC 9(5)  COMP-3  VALUE ZERO.
          07  C-WAIT-COUNTER          PIC 9(5)  COMP-3  VALUE ZERO.
          07  C-START-MERKER          PIC X            VALUE "N".
           88 C-START                 VALUE "Y".
          07  C-STOP-MERKER           PIC X            VALUE "N".
           88 C-STOP                  VALUE "Y".
          07  C-KEY                   PIC X(13)         VALUE ZERO.
      /  
         05   D-FELD.
          07  D-COUNTER               PIC 9(5)   COMP-3 VALUE ZERO.
          07  D-MAX                   PIC 9(5)   COMP-3 VALUE ZERO.
          07  D-TRIGGER-COUNTER       PIC 9(5)   COMP-3 VALUE ZERO.
          07  D-TRIGGER-MAX           PIC 9(5)   COMP-3 VALUE ZERO.
          07  D-WAIT-COUNTER          PIC 9(5)   COMP-3 VALUE ZERO.
          07  D-START-MERKER          PIC X             VALUE "N".
           88 D-START                 VALUE "Y".
          07  D-STOP-MERKER           PIC X             VALUE "N".
           88 D-STOP                  VALUE "Y".
          07  D-KEY                   PIC X(13)         VALUE ZERO.
      * 
         05   E-FELD.
          07  E-COUNTER               PIC 9(5)   COMP-3 VALUE ZERO.
          07  E-MAX                   PIC 9(5)   COMP-3 VALUE ZERO.
          07  E-TRIGGER-COUNTER       PIC 9(5)   COMP-3 VALUE ZERO.
          07  E-TRIGGER-MAX           PIC 9(5)   COMP-3 VALUE ZERO.
          07  E-WAIT-COUNTER          PIC 9(5)   COMP-3 VALUE ZERO.
          07  E-START-MERKER          PIC X             VALUE "N".
           88 E-START                 VALUE "Y".
          07  E-STOP-MERKER           PIC X             VALUE "N".
           88 E-STOP                  VALUE "Y".
          07  E-KEY                   PIC X(13)         VALUE ZERO.
      *  
         05   F-FELD.
          07  F-COUNTER               PIC 9(5)   COMP-3 VALUE ZERO.
          07  F-MAX                   PIC 9(5)   COMP-3 VALUE ZERO.
          07  F-TRIGGER-COUNTER       PIC 9(5)   COMP-3 VALUE ZERO.
          07  F-TRIGGER-MAX           PIC 9(5)   COMP-3 VALUE ZERO.
          07  F-WAIT-COUNTER          PIC 9(5)   COMP-3 VALUE ZERO.
          07  F-START-COUNTER         PIC X             VALUE "N".
           88 F-START                 VALUE "Y".
          07  F-STOP-MERKER           PIC X             VALUE "N".
           88 F-STOP                  VALUE "Y".
          07  F-KEY                   PIC X(13)         VALUE ZERO.
      *
        03    A-F-DATEN-R REDEFINES A-F-DATEN.
         05   X-FELD                   OCCURS 6 TIMES.
          07   X-COUNTER               PIC 9(5)   COMP-3.
          07   X-MAX                   PIC 9(5)   COMP-3.
          07   X-TRIGGER-COUNTER       PIC 9(5)   COMP-3.
          07   X-TRIGGER-MAX           PIC 9(5)   COMP-3.
          07   X-WAIT-COUNTER          PIC 9(5)   COMP-3.
          07   X-START-MERKER          PIC X.
           88  X-START                 VALUE "Y".
          07   X-STOP-MERKER           PIC X.
           88  X-STOP                  VALUE "Y".
          07   X-KEY                   PIC X(13).
      *   
       01      WAIT-BLOCK.
        03     WAIT-COUNTER            PIC 9(5)   COMP-3 VALUE ZERO.
      * 
       PROCEDURE DIVISION.
       DECLARATIVES.
       I-O-ERROR SECTION.
           USE AFTER ERROR PROCEDURE ON IDA-O-1.
      *                                 IDA-I-1.
       DISPLAY-FS-STATUS.
               DISPLAY " FILE-STATUS IDA-O-1 = " FI-STA-O-1.
      *                " FILE-STATUS IDA-I-1 = " FI-STA-I-1.
       END DECLARATIVES.
      *
       STEUERUNG SECTION.
       EINGABE-ANFANG.
           MOVE SPACES TO EINGABE.
           ACCEPT EINGABE.
           IF RUN-CODE                         GO TO A-ANFANG.
           IF DELETE-CODE                      GO TO DELETE-ANFANG.
           IF DISPLAY-CODE                     GO TO DISPLAY-ANFANG.
           IF END-CODE                         GO TO STEUERUNG-ENDE.
           IF COMMENT-CODE                     MOVE EINGABE TO KOMMENTAR
                                               GO TO EINGABE-ANFANG.
           IF OPEN-CODE                        GO TO OPEN-ANFANG.
           IF CLOSE-CODE                       GO TO CLOSE-ANFANG.
           MOVE ZEICHEN-1 TO A-F-STRING-ENDE.
           MOVE ZERO TO X-SPALTE.
           INSPECT A-F-STRING
                      TALLYING X-SPALTE FOR CHARACTERS BEFORE INITIAL
                      ZEICHEN-1.                         
           ADD 1 TO X-SPALTE.
           IF X-SPALTE GREATER THAN 6
                      GO TO FEHLER-ANFANG.
      *    START- UND STOP-MERKER
           MOVE ZERO TO SPALTE.
           INSPECT EINGABE
                      TALLYING SPALTE FOR CHARACTERS BEFORE INITIAL
                      ET-CODE.                           
           IF SPALTE LESS THAN 7       GO TO FEHLER-ANFANG.
           IF START-CODE               GO TO START-ANFANG.
           IF STOP-CODE                GO TO STOP-ANFANG.
           MOVE ZERO TO SPALTE.
           INSPECT EINGABE
                      TALLYING SPALTE FOR CHARACTERS BEFORE INITIAL
                      "=".             
           IF SPALTE LESS THAN 5       GO TO FEHLER-ANFANG.
           ADD 2, SPALTE GIVING SPALTE-MIN.
           MOVE ZERO TO SPALTE.
           INSPECT EINGABE
                      TALLYING SPALTE FOR CHARACTERS BEFORE INITIAL
                      ET-CODE.         
           IF SPALTE LESS THAN 7       GO TO FEHLER-ANFANG.
           IF KEY-CODE                 GO TO KEY-ANFANG.
      *    ZAEHLER.
           SUBTRACT SPALTE-MIN FROM SPALTE GIVING EINGABE-WERT.
           IF EINGABE-WERT GREATER THAN 4
                                       GO TO FEHLER-ANFANG. 
           IF COUNTER-CODE             GO TO COUNTER-ANFANG.
           IF TRIGGER-CODE             GO TO TRIGGER-ANFANG.
           IF WAIT-CODE                GO TO WAIT-ANFANG.
      /
       FEHLER-ANFANG.
           DISPLAY " EINGABEFEHLER ".
      D    DISPLAY EINGABE.
      D    DISPLAY " ZEICHEN-1 : "ZEICHEN-1 " ZEICHEN 3-5 :" ZEICHEN-3-5.
      D    DISPLAY "EINGABEWERT : " EINGABE-WERT.
      D    MOVE X-SPALTE TO EINGABE-WERT.
      D    DISPLAY "ZIFFER FUER 1. ZEICHEN : " EINGABE-WERT.
      D    MOVE SPALTE TO EINGABE-WERT.
      D    DISPLAY "INSPECT-ZAEHLER = " EINGABE-WERT.
           GO TO EINGABE-ANFANG.
       EINGABE-ENDE.
      /
      ********************************************************************
      *                                                    
      *                               DELETE 
      * 
      ********************************************************************
       DELETE-ANFANG.
           MOVE 1 TO X-SPALTE.
           MOVE SPACE TO KOMMENTAR.
       DELETE-LOOP.
           IF X-SPALTE NOT GREATER THAN 6
                      MOVE ZERO TO X-COUNTER(X-SPALTE), X-MAX(X-SPALTE),
                                   X-TRIGGER-COUNTER(X-SPALTE),
                                   X-TRIGGER-MAX(X-SPALTE),
                                   X-WAIT-COUNTER(X-SPALTE),
                                   X-KEY(X-SPALTE)       
                      MOVE "N" TO  X-START-MERKER(X-SPALTE),
                      ADD 1 TO X-SPALTE
                      GO TO DELETE-LOOP.
           GO TO EINGABE-ANFANG.
      *******************************************************************
      *
      *                       DISPLAY
      *
      *******************************************************************
       DISPLAY-ANFANG.
           DISPLAY KOMMENTAR.
           MOVE 1 TO X-SPALTE.
           MOVE "A" TO X-DISPLAY.
       DISPLAY-LOOP.
           IF X-SPALTE NOT GREATER THAN 6
                      MOVE X-MAX(X-SPALTE) TO COUNTER-DISPLAY
                      MOVE X-TRIGGER-MAX(X-SPALTE) TO TRIGGER-DISPLAY
                      MOVE X-WAIT-COUNTER(X-SPALTE) TO WAIT-DISPLAY
                      MOVE X-START-MERKER(X-SPALTE) TO START-DISPLAY
                      MOVE X-STOP-MERKER(X-SPALTE) TO STOP-DISPLAY
                      MOVE X-KEY(X-SPALTE) TO KEY-DISPLAY
                      DISPLAY "  " X-DISPLAY "-ROUTINE :         "
                      X-DISPLAY "-COUNTER = " COUNTER-DISPLAY
                      DISPLAY "    " X-DISPLAY "-TRIGGER = " 
						TRIGGER-DISPLAY
                      "    " X-DISPLAY "-WAIT = " WAIT-DISPLAY
                      DISPLAY "    "X-DISPLAY "-START   = " 
						START-DISPLAY
                      "        " X-DISPLAY "-STOP = " STOP-DISPLAY
                      DISPLAY "    " X-DISPLAY "-KEY    = " KEY-DISPLAY
                      ADD 1 TO X-SPALTE
                      ADD 10 TO X-NUMERISCH
                      GO TO DISPLAY-LOOP.
           GO TO EINGABE-ANFANG.
      /*********************************************************************
      *
      *                        START- UND STOP-MERKER
      *
      **********************************************************************
       START-ANFANG.
           MOVE "N" TO X-START-MERKER(X-SPALTE).
           IF EINGABE-SPALTE(SPALTE) EQUAL TO "Y"
                                       GO TO START-YES.
           IF EINGABE-SPALTE(SPALTE) EQUAL TO "S"
                                       GO TO START-YES.
           IF EINGABE-SPALTE(SPALTE) EQUAL TO "N"
                                       GO TO EINGABE-ANFANG.
           IF EINGABE-SPALTE(SPALTE) EQUAL TO "O"
                                       GO TO EINGABE-ANFANG.
      *    ELSE
           GO TO FEHLER-ANFANG.
       START-YES.
           MOVE "Y" TO X-START-MERKER(X-SPALTE).
           GO TO EINGABE-ANFANG.
      *
       STOP-ANFANG.
           MOVE "N" TO X-STOP-MERKER(X-SPALTE).
           IF EINGABE-SPALTE(SPALTE) EQUAL TO "Y"
                                       GO TO STOP-YES.
           IF EINGABE-SPALTE(SPALTE) EQUAL TO "S"
                                       GO TO STOP-YES.          
           IF EINGABE-SPALTE(SPALTE) EQUAL TO "N"
                                       GO TO EINGABE-ANFANG.
           IF EINGABE-SPALTE(SPALTE) EQUAL TO "O"
                                       GO TO EINGABE-ANFANG.
      *    ELSE
           GO TO FEHLER-ANFANG.
       STOP-YES.
           MOVE "Y" TO X-STOP-MERKER(X-SPALTE).
           GO TO EINGABE-ANFANG.
      /*******************************************************************
      *
      *           COUNTER- ,TRIGGER- UND WAIT-ZAEHLER
      *
      ********************************************************************
       COUNTER-ANFANG.
           MOVE ZERO TO EINGABE-WERT.
           SET NU-SP TO 5.
       COUNTER-LOOP.
           IF SPALTE NOT LESS THAN SPALTE-MIN
                      MOVE EINGABE-SPALTE(SPALTE) TO
                                       EINGABE-NU-SP(NU-SP)
                      SUBTRACT 1 FROM SPALTE
                      SET NU-SP DOWN BY 1
                      GO TO COUNTER-LOOP.                
           IF EINGABE-WERT NOT NUMERIC                   
                      GO TO FEHLER-ANFANG.
           MOVE EINGABE-WERT TO X-MAX(X-SPALTE).
           GO TO EINGABE-ANFANG.
      *
       TRIGGER-ANFANG.
           MOVE ZERO TO EINGABE-WERT.                    
           SET NU-SP TO 5.
       TRIGGER-LOOP.
           IF SPALTE NOT LESS THAN SPALTE-MIN
                      MOVE EINGABE-SPALTE(SPALTE) TO
                           EINGABE-NU-SP(NU-SP)
                      SUBTRACT 1 FROM SPALTE
                      SET NU-SP DOWN BY 1
                      GO TO TRIGGER-LOOP.
           IF EINGABE-WERT NOT NUMERIC
                      GO TO FEHLER-ANFANG.
           MOVE EINGABE-WERT TO X-TRIGGER-MAX(X-SPALTE).
           GO TO EINGABE-ANFANG.
      *
       WAIT-ANFANG.
           MOVE ZERO TO EINGABE-WERT.
           SET NU-SP TO 5.
       WAIT-LOOP.
           IF SPALTE NOT LESS THAN SPALTE-MIN
                      MOVE EINGABE-SPALTE(SPALTE) TO
                           EINGABE-NU-SP(NU-SP)
                      SUBTRACT 1 FROM SPALTE
                      SET NU-SP DOWN BY 1
                      GO TO WAIT-LOOP. 
           IF EINGABE-WERT NOT NUMERIC
                      GO TO FEHLER-ANFANG.
           MOVE EINGABE-WERT TO X-WAIT-COUNTER(X-SPALTE).
           GO TO EINGABE-ANFANG.
      /******************************************************************
      *
      *                            KEY 
      *
      *******************************************************************
       KEY-ANFANG.
           MOVE ZEROES TO EINGABE-ALPHA-WERT.
           SET AL-SP TO 13.
       KEY-LOOP.
           IF SPALTE NOT LESS THAN SPALTE-MIN
                      MOVE EINGABE-SPALTE(SPALTE) TO
                                   EINGABE-AL-SP(AL-SP)
                      SUBTRACT 1 FROM SPALTE
                      SET AL-SP DOWN BY 1
                      GO TO KEY-LOOP.
           MOVE EINGABE-ALPHA-WERT TO X-KEY(X-SPALTE).
           GO TO EINGABE-ANFANG.
      *
      *                    OPEN
      *
       OPEN-ANFANG.
           OPEN I-O    IDA-O-1.
      *    OPEN INPUT  IDA-I-1.
           GO TO EINGABE-ANFANG.
      *
      *                    CLOSE
      *
       CLOSE-ANFANG.
           CLOSE IDA-O-1.
      *    CLOSE IDA-I-1.
           GO TO EINGABE-ANFANG.
      /
      ******************************************************************
      *
      *                        RUN
      *
      ******************************************************************
       A-ANFANG.
           IF A-START DISPLAY "START"
                      CALL "SETTIM".
       A-LOOP.
           IF A-COUNTER NOT LESS THAN A-MAX 
                      GO TO A-ENDE.
           IF A-WAIT-COUNTER NOT EQUAL TO 0
                      MOVE A-WAIT-COUNTER TO WAIT-COUNTER.
      *               CALL "WAITM" USING WAIT-BLOCK.
      *** A-ROUTINE
           MOVE A-KEY TO REC-KEY.
           ADD 10 TO W-KEY.
           MOVE REC-KEY TO REC-KEY-O-1, A-KEY.
           DELETE IDA-O-1.

      *
           IF A-TRIGGER-MAX EQUAL TO 0
                      GO TO A010.
           ADD 1 TO A-TRIGGER-COUNTER.
           IF A-TRIGGER-COUNTER EQUAL TO A-TRIGGER-MAX
                      DISPLAY "TRIGGER"
                      MOVE 0 TO A-TRIGGER-COUNTER.
       A010.
           ADD 1 TO A-COUNTER.
           GO TO A-LOOP.
       A-ENDE.
           IF A-STOP  CALL "GETTIM" USING TIMER
                      MOVE HOURS TO STUNDE
                      MOVE MINUTES TO MINUTE
                      MOVE SECONDS TO SEKUND
                      DISPLAY "STUNDEN : " STUNDE
                      DISPLAY "MINUTEN : " MINUTE
                      DISPLAY "SEKUNDEN: " SEKUND.
           MOVE 0 TO A-COUNTER, A-TRIGGER-COUNTER.
      *
       B-ANFANG.
           IF B-START DISPLAY "START".
       B-LOOP.
           IF B-COUNTER NOT LESS THAN B-MAX 
                      GO TO B-ENDE.
           IF B-WAIT-COUNTER NOT EQUAL TO 0
                      MOVE B-WAIT-COUNTER TO WAIT-COUNTER.
      *               CALL "WAITM" USING WAIT-BLOCK.
      *** B-ROUTINE
           OPEN OUTPUT IDA-O-1.
      *
           IF B-TRIGGER-MAX EQUAL TO 0
                      GO TO B010.
           ADD 1 TO B-TRIGGER-COUNTER.
           IF B-TRIGGER-COUNTER EQUAL TO B-TRIGGER-MAX
                      DISPLAY "TRIGGER"
                      MOVE 0 TO B-TRIGGER-COUNTER.
       B010.
           ADD 1 TO B-COUNTER.
           GO TO B-LOOP.
       B-ENDE.
           IF B-STOP
                      DISPLAY "STOP" .
           MOVE 0 TO B-COUNTER, B-TRIGGER-COUNTER.
      *
       C-ANFANG.
           IF C-START DISPLAY "START".
       C-LOOP.
           IF C-COUNTER NOT LESS THAN C-MAX 
                      GO TO C-ENDE.
           IF C-WAIT-COUNTER NOT EQUAL TO 0
                      MOVE C-WAIT-COUNTER TO WAIT-COUNTER.
      *               CALL "WAITM" USING WAIT-BLOCK.
      *** C-ROUTINE
           MOVE C-KEY TO REC-KEY.
           ADD 10 TO W-KEY.
           MOVE REC-KEY TO REC-KEY-O-1, C-KEY.
           READ IDA-O-1.
           REWRITE REC-O-1.
      *
           IF C-TRIGGER-MAX EQUAL TO 0
                      GO TO C010.
           ADD 1 TO C-TRIGGER-COUNTER.
           IF C-TRIGGER-COUNTER EQUAL TO C-TRIGGER-MAX
                      DISPLAY "TRIGGER"
                      MOVE 0 TO C-TRIGGER-COUNTER.
       C010.
           ADD 1 TO C-COUNTER.
           GO TO C-LOOP.
       C-ENDE.
           IF C-STOP
                      DISPLAY "STOP" .
           MOVE 0 TO C-COUNTER, C-TRIGGER-COUNTER.
      *
       D-ANFANG.
           IF D-START DISPLAY "START"
           CALL "SET.COM".
       D-LOOP.
           IF D-COUNTER NOT LESS THAN D-MAX 
                      GO TO D-ENDE.
           IF D-WAIT-COUNTER NOT EQUAL TO 0
                      MOVE D-WAIT-COUNTER TO WAIT-COUNTER.
      *               CALL "WAITM" USING WAIT-BLOCK.
      *** D-ROUTINE
           MOVE D-KEY TO REC-KEY. 
           ADD 10 TO W-KEY.
           MOVE REC-KEY TO REC-KEY-O-1, D-KEY.
           READ IDA-O-1.
      *
           IF D-TRIGGER-MAX EQUAL TO 0
                      GO TO D010.
           ADD 1 TO D-TRIGGER-COUNTER.
           IF D-TRIGGER-COUNTER EQUAL TO D-TRIGGER-MAX
                      DISPLAY "TRIGGER"
                      MOVE 0 TO D-TRIGGER-COUNTER.
       D010.
           ADD 1 TO D-COUNTER.
           GO TO D-LOOP.
       D-ENDE.
           IF D-STOP  CALL "GET.COM" USING TIMER
                      MOVE HOURS TO STUNDE
                      MOVE MINUTES TO MINUTE
                      MOVE SECONDS TO SEKUND
                      DISPLAY "STUNDEN : " STUNDE
                      DISPLAY "MINUTEN : " MINUTE
                      DISPLAY "SEKUNDEN: " SEKUND.
           MOVE 0 TO D-COUNTER, D-TRIGGER-COUNTER.
      *
       E-ANFANG.
           IF E-START DISPLAY "START"
                      CALL "SET.COM".
       E-LOOP.
           IF E-COUNTER NOT LESS THAN E-MAX 
                      GO TO E-ENDE.
           IF E-WAIT-COUNTER NOT EQUAL TO 0
                      MOVE E-WAIT-COUNTER TO WAIT-COUNTER.
      *               CALL "WAITM" USING WAIT-BLOCK.
      *** E-ROUTINE
           MOVE E-KEY TO REC-KEY. 
           ADD 10 TO W-KEY.
           MOVE REC-KEY TO REC-KEY-O-1, E-KEY.
           MOVE "IDA-O-1..." TO ZEICHEN-TEXT-O-1.
           MOVE SPACES TO ZEICHEN-TEXT-O-2.
           WRITE REC-O-1.
      *
           IF E-TRIGGER-MAX EQUAL TO 0
                      GO TO E010.
           ADD 1 TO E-TRIGGER-COUNTER.
           IF E-TRIGGER-COUNTER EQUAL TO E-TRIGGER-MAX
                      DISPLAY "TRIGGER"
                      MOVE 0 TO E-TRIGGER-COUNTER.
       E010.
           ADD 1 TO E-COUNTER.
           GO TO E-LOOP.
       E-ENDE.
           IF E-STOP CALL "GET.COM" USING TIMER
                     MOVE HOURS TO STUNDE
                     MOVE MINUTES TO MINUTE
                     MOVE SECONDS TO SEKUND
                     DISPLAY "STUNDEN : " STUNDE
                     DISPLAY "MINUTEN : " MINUTE
                     DISPLAY "SEKUNDEN: " SEKUND.
           MOVE 0 TO E-COUNTER, E-TRIGGER-COUNTER.
      *
       F-ANFANG.
           IF F-START DISPLAY "START".
       F-LOOP.
           IF F-COUNTER NOT LESS THAN F-MAX 
                      GO TO F-ENDE.
           IF F-WAIT-COUNTER NOT EQUAL TO 0
                      MOVE F-WAIT-COUNTER TO WAIT-COUNTER.
      *               CALL "WAITM" USING WAIT-BLOCK.
      *** F-ROUTINE
           MOVE E-KEY TO REC-KEY-O-1.
           READ IDA-O-1.
           MOVE F-KEY TO REC-KEY-O-1.
           READ IDA-O-1.
      *
           IF F-TRIGGER-MAX EQUAL TO 0
                      GO TO F010.
           ADD 1 TO F-TRIGGER-COUNTER.
           IF F-TRIGGER-COUNTER EQUAL TO F-TRIGGER-MAX
                      DISPLAY "TRIGGER"
                      MOVE 0 TO F-TRIGGER-COUNTER.
       F010.
           ADD 1 TO F-COUNTER.
           GO TO F-LOOP.
       F-ENDE.
           IF F-STOP
                      DISPLAY "STOP" .
           MOVE 0 TO F-COUNTER, F-TRIGGER-COUNTER.
      *
       RUN-ENDE.
           GO TO EINGABE-ANFANG.
      *
       STEUERUNG-ENDE.
           STOP RUN.
