       IDENTIFICATION DIVISION.
       PROGRAM-ID.  VDTTST.
      *            (TERMINAL CONFIGURATION TEST)
      *
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       SOURCE-COMPUTER. RMCOBOL.
       OBJECT-COMPUTER. RMCOBOL.
      *
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       77  COMMAND-NUMBER PIC 99.
       77  N              PIC 99.
       77  EXC-NUM            PIC 99.
       77  EXC-NUM2           PIC 99.
       77  ONE-CHAR       PIC X.
       77  R              PIC 99.
       77  OTHER          PIC X(10).
       77  FRIEND         PIC X(10).
       77  C              PIC 999.
       77  NAME           PIC X(10).
       77  LINE-NO        PIC 99.
       77  DATE-FLD       PIC 9(6).
       77  DAY-FLD        PIC 9(5).
       77  TIME-FLD       PIC 9(8).
       77  OP-1           PIC S9(9)V9(9).
       77  RESULT         PIC -(9)9.9(9).
      /
       PROCEDURE DIVISION.
       ENTER-COMMAND.
           DISPLAY "           TERMINAL CONFIGURATION TEST" ERASE.
           DISPLAY " ".
           DISPLAY "       1.  ACCEPT WITH AND WITHOUT PROMPT".
           DISPLAY "       2.  ACCEPT/DISPLAY WITH AND WITHOUT BEEP".
           DISPLAY "       3.  ACCEPT WITH AND WITHOUT TAB".
           DISPLAY "       4.  ACCEPT/DISPLAY WITH DEFAULT VALUES".
           DISPLAY "       5.  ACCEPT/DISPLAY USING ALTERNATE CRTS".
           DISPLAY "       6.  CHECK SCREEN DIMENSIONS".
           DISPLAY "       7.  ACCEPT WITH SECURE".
           DISPLAY "       8.  ACCEPT/DISPLAY WITH REVERSE".
           DISPLAY "       9.  ACCEPT DATE & TIME".
           DISPLAY "       10. HIGH/LOW INTENSITY".
           DISPLAY "       11. ACCEPT WITH BLINK".
           DISPLAY "       12. ACCEPT WITH ON EXCEPTION CLAUSE".
           DISPLAY "       13. EXIT PROGRAM".
           DISPLAY " ".
           DISPLAY "           ENTER COMMAND NUMBER      ".
       ACCEPT-COMMAND-NUMBER.
           ACCEPT COMMAND-NUMBER LINE 17 POSITION 38 TAB.
           GO TO TEST-1-PARA, TEST-2-PARA, TEST-3-PARA,
               TEST-4-PARA, TEST-5-PARA, TEST-6-PARA, TEST-7-PARA,
               TEST-8-PARA, TEST-9-PARA, TEST-10-PARA,
               TEST-11-PARA, TEST-12-PARA, EXIT-PARA
                   DEPENDING ON COMMAND-NUMBER.
           DISPLAY "  " LINE 17 POSITION 38.
           GO TO ACCEPT-COMMAND-NUMBER.
      /
       TEST-1-PARA.
           DISPLAY " ACCEPT WITH AND WITHOUT PROMPT "
                LINE 1 POSITION 9 ERASE.
           DISPLAY "A.  ACCEPT WITH NO PROMPT" LINE 2.
           DISPLAY "ENTER YOUR NAME:  " LINE 3 POSITION 10.
           ACCEPT NAME POSITION 0.
      *
           DISPLAY "B.  ACCEPT WITH DEFAULT PROMPT CHARACTER" LINE 5.
           DISPLAY "ENTER YOUR FRIEND'S NAME:  " LINE 6 POSITION 10.
           ACCEPT FRIEND POSITION 0 PROMPT.
      *
           DISPLAY "C.  ACCEPT WITH USER-SPECIFIED PROMPT CHAR" LINE 8.
           DISPLAY "ENTER YOUR OTHER FRIEND'S NAME: "
                LINE 9 POSITION 9.
           ACCEPT OTHER POSITION 0 PROMPT "H"
      *
           DISPLAY "HIT NEWLINE TO RETURN TO COMMAND MODE"
             LINE 12.
           ACCEPT ONE-CHAR POSITION 0.
           GO ENTER-COMMAND.
      *
       TEST-2-PARA.
           DISPLAY "ACCEPT/DISPLAY WITHOUT AND WITHOUT BEEP"
               LINE 1 ERASE.
           DISPLAY "A. ACCEPT WITH BEEP"  LINE 2.
           DISPLAY "ENTER THE NAME OF YOUR FAVORITE BEEP: "
               LINE 3 POSITION 10.
           ACCEPT NAME POSITION 0 PROMPT.
      *
           DISPLAY "B. ACCEPT WITHOUT BEEP" LINE 4
           DISPLAY "ENTER THE NAME OF YOUR FAVORITE NON-BEEP: "
               LINE 5 POSITION 10.
           ACCEPT NAME POSITION 0 PROMPT NO BEEP.
      *
           DISPLAY "C. DISPLAY WITH BEEP" LINE 6.
           DISPLAY "NOW THAT WAS A REAL GOOD BEEP!!"
               LINE 7 POSITION 10 BEEP.
           DISPLAY "D. DISPLAY WITHOUT BEEP (HIT NEWLINE)"
               LINE 8.
           ACCEPT NAME POSITION 0 NO BEEP.
           DISPLAY "I DIDN'T HEAR A BEEP OUT OF YOU"
               LINE 9.
           DISPLAY "HIT NEWLINE TO RETURN TO COMMAND MODE:"
               LINE 11.
           ACCEPT ONE-CHAR POSITION 0 NO BEEP.
           GO ENTER-COMMAND.
      /
       TEST-3-PARA.
           DISPLAY "ACCEPT WITH AND WITHOUT TAB" LINE 1
               POSITION 15  ERASE.
           DISPLAY "ENTER A STRING OF 10 CHARS. AN AUTOMATIC "
               LINE 2.
           DISPLAY "TAB SHOULD NOT OCCUR AFTER THE LAST CHARACTER "
               LINE 3.
           DISPLAY "IS TYPED." POSITION 0
           ACCEPT NAME LINE 4 POSITION 15 PROMPT TAB, ECHO.
            DISPLAY NAME LINE 5 POSITION 15.
      *
           DISPLAY "ENTER A STRING OF TEN CHARACTERS. AN AUTOMATIC "
               LINE 6.
           DISPLAY "TAB SHOULD OCCUR AFTER THE LAST CHARACTER HAS "
               LINE 7.
           DISPLAY "BEEN TYPED." POSITION 0.
           ACCEPT NAME LINE 8 POSITION 15 PROMPT, ECHO.
            DISPLAY NAME LINE 9 POSITION 15.
      *
           DISPLAY "HIT NEWLINE TO REENTER COMMAND MODE." LINE 10.
           ACCEPT ONE-CHAR POSITION 0.
           GO ENTER-COMMAND.
      *
       TEST-4-PARA.
           DISPLAY "ACCEPT AND DISPLAY W/ DEFAULT CURSOR POSITION"
              LINE 1 POSITION 15 ERASE.
           DISPLAY "THIS LINE SHOULD START ON LINE 2 POSITION 1."
           DISPLAY "THIS LINE SHOULD START ON LINE 3 POSITION 15."
              POSITION 15.
           DISPLAY "THIS LINE SHOULD START ON LINE 4 POSITION 1."
              LINE 4 POSITION 1.
           DISPLAY "THIS LINE SHOULD START ON LINE 5 POSITION 1."
              LINE 5.
           DISPLAY " THIS LINE SHOULD APPEAR ON LINE 24 POSITION 10."
              LINE 24 POSITION 10.
           DISPLAY "HIT NEWLINE TO CONTINUE" LINE 12.
           ACCEPT ONE-CHAR POSITION 0.
           DISPLAY "THIS LINE SHOULD APPEAR ON NEXT LINE POSITION 4."
              POSITION 4.
           DISPLAY "ACCEPT/DISPLAY DEFAULT TEST (POSITION 0) " LINE 15.
           DISPLAY "ENTER FIELD " POSITION 0.
           ACCEPT NAME POSITION 0 PROMPT.
           DISPLAY " ACCEPT AGAIN " POSITION 0.
           ACCEPT FRIEND POSITION 0 PROMPT.
           DISPLAY " ONE MORE TIME " POSITION 0.
           ACCEPT OTHER POSITION 0 PROMPT.
           DISPLAY "HIT NEWLINE TO REENTER COMMAND MODE " LINE 18.
           ACCEPT ONE-CHAR POSITION 0.
           GO ENTER-COMMAND.
      /
       TEST-5-PARA.
           DISPLAY "ACCEPT AND DISPLAY TO ALTERNATE CRTS "
              LINE 1 POSITION 15 ERASE.
           DISPLAY
           "TO WHICH CRT WOULD YOU LIKE TO SEND AN INVITATION?"
           LINE 3 .
           ACCEPT N POSITION 0 PROMPT.
           DISPLAY "PLEASE COME TO DINNER AT MY PENTHOUSE"
           UNIT N LINE 3 ERASE.
           DISPLAY "APARTMENT TUESDAY NIGHT. R.S.V.P. (YES/NO)"
           UNIT N LINE 4.
           ACCEPT NAME UNIT N LINE 4 POSITION 0.
           IF NAME = "NO" DISPLAY
           "I MUST REGRETFULLY DECLINE YOUR GRACIOUS INVITATION"
           LINE 5.
           IF NAME = "YES" DISPLAY
           "I'LL BRING A BOTTLE OF WINE WITH ME."
           LINE 5.
           DISPLAY "HIT NEWLINE TO RETURN TO COMMAND MODE." LINE 7.
           ACCEPT ONE-CHAR POSITION 0.
           GO ENTER-COMMAND.
      *
       TEST-6-PARA.
           DISPLAY "CHECK SCREEN DIMENSIONS"
                LINE 1 POSITION 10 ERASE.
           DISPLAY "HOW MANY ROWS ARE THERE ON YOUR CRT? " LINE 3.
           ACCEPT R POSITION 0 PROMPT TAB.
           DISPLAY "HOW MAY COLUMNS? "  LINE 5.
           ACCEPT C POSITION 0 PROMPT TAB.
           DISPLAY "YOU SHOULD SEE AN ASTERISK IN EACH CORNER OF SCREEN"
           LINE 7.
           DISPLAY "( AFTER HITTING NEWLINE KEY)" POSITION 0.
           ACCEPT ONE-CHAR POSITION 0.
           DISPLAY "*" LINE 1 POSITION 1 ERASE.
           DISPLAY "*" LINE R.
           DISPLAY "*" LINE 1 POSITION C.
           DISPLAY "*" LINE R POSITION C.
           DISPLAY "ENTER '0' TO DISPLAY LINE NOS, OTHERWISE 'RETURN'"
             LINE 6 POSITION 15.
           ACCEPT ONE-CHAR POSITION 0.
           IF ONE-CHAR NOT = "0" GO TO ENTER-COMMAND.
           MOVE 1 TO LINE-NO.
           PERFORM DISPLAY-LINE-NO  R  TIMES.
           ACCEPT ONE-CHAR POSITION 0.
           GO ENTER-COMMAND.
      *
       DISPLAY-LINE-NO.
           DISPLAY  LINE-NO,  LINE LINE-NO, POSITION 1.
           ADD 1 TO LINE-NO.
       DISPLAY-LINE-NO-END.
      /
       TEST-7-PARA.
           DISPLAY "ACCEPT WITH/WITHOUT OFF" LINE 1 ERASE.
           DISPLAY "THIS LINE SHOULD REMAIN UNCHANGED"
               LINE 22 POSITION 10.
           DISPLAY "ENTER YOUR CODE NAME: " LINE 5 POSITION 10.
           ACCEPT NAME POSITION 0 PROMPT OFF.
           DISPLAY "YOUR NAME IS " LINE 7 POSITION 10.
           DISPLAY NAME POSITION 0.
           DISPLAY "HIT NEWLINE TO RETURN TO COMMAND MODE:" LINE 13.
           ACCEPT ONE-CHAR POSITION 0 NO BEEP.
           GO ENTER-COMMAND.
      *
       TEST-8-PARA.
           DISPLAY "ACCEPT/DISPLAY IN REVERSE"
                LINE 1 ERASE REVERSE.
           DISPLAY "THIS LINE SHOULD REMAIN UNCHANGED"
                LINE 22 POSITION 10.
           DISPLAY " DISPLAY WITH EXTRA SPACES "
                LINE 5 POSITION 10 REVERSE.
           DISPLAY "ACCEPT IN REVERSE: " LINE 8 POSITION 10.
           ACCEPT NAME POSITION 0 REVERSE.
           DISPLAY "ACCEPT W/PROMPT: " LINE 10 POSITION 10.
           ACCEPT NAME POSITION 0 PROMPT " " REVERSE.
           DISPLAY "ACCEPT W/DEF PROMPT: " LINE 12 POSITION 10.
           ACCEPT NAME POSITION 0 PROMPT REVERSE.
           DISPLAY "HIT NEWLINE TO RETURN TO COMMAND MODE"
                LINE 15.
           ACCEPT ONE-CHAR POSITION 0.
           GO ENTER-COMMAND.
      *
       TEST-9-PARA.
           DISPLAY "ACCEPT TIME & DATE" LINE 1 ERASE.
           ACCEPT DATE-FLD FROM DATE.
           ACCEPT DAY-FLD FROM DAY.
           ACCEPT TIME-FLD FROM TIME.
           DISPLAY " ".
           DISPLAY "DATE IS (YYMMDD): " DATE-FLD.
           DISPLAY "JULIAN  (YYDDD):  " DAY-FLD.
           DISPLAY "TIME IS (HHMMSSss): " TIME-FLD.
           DISPLAY "Hit newline to return to command mode"
               LINE 20 POSITION 40.
           ACCEPT ONE-CHAR POSITION 0.
           GO TO ENTER-COMMAND.
      /
       TEST-10-PARA.
           DISPLAY "HIGH/LOW INTENSITY AND DEFAULT POSITIONING"
               LINE 1 ERASE.
           DISPLAY "THIS LINE SHOULD REMAIN UNCHANGED"
               LINE 22 POSITION 10.
           DISPLAY "DISPLAY LOW, ACCEPT LOW" LINE 4 POSITION 50.
           DISPLAY "DISPLAY LOW, ACCEPT HIGH" LINE 6 POSITION 50.
           DISPLAY "  W/ DEFAULT POSITIONING" LINE 8 POSITION 50.
           DISPLAY "OPERAND-1 = " LINE 4 LOW.
           ACCEPT OP-1 LINE 4 POSITION 13 SIZE 10 PROMPT CONVERT LOW.
           MOVE OP-1 TO RESULT.
           DISPLAY RESULT LINE 4 POSITION 13 LOW.
           DISPLAY "OPERAND-2 = " LINE 6 LOW.
           ACCEPT OP-1 LINE 6 POSITION 13 SIZE 10 PROMPT CONVERT HIGH.
           MOVE OP-1 TO RESULT.
           DISPLAY RESULT LINE 6 POSITION 13 LOW.
           DISPLAY "OPERAND-3 = " LINE 8 LOW.
           ACCEPT OP-1 POSITION 0 SIZE 10 PROMPT CONVERT HIGH.
           MOVE OP-1 TO RESULT.
           DISPLAY "RESULT=" POSITION 0 LOW.
           DISPLAY RESULT POSITION 0 LOW.
           DISPLAY "HIT NEWLINE TO RETURN TO COMMAND MODE" LINE 15.
           ACCEPT ONE-CHAR POSITION 0 PROMPT.
           GO ENTER-COMMAND.
      *
       TEST-11-PARA.
           DISPLAY "ACCEPT/DISPLAY WITH BLINK"
                LINE 1 ERASE BLINK.
           DISPLAY "THIS LINE SHOULD REMAIN UNCHANGED"
                LINE 22 POSITION 10.
           DISPLAY " DISPLAY WITH EXTRA SPACES "
                LINE 5 POSITION 10 BLINK REVERSE.
           DISPLAY "BLINK/REVERSE VIDEO" LINE 5 POSITION 60.
           DISPLAY " DISPLAY WITH EXTRA SPACES "
                LINE 7 POSITION 10 LOW BLINK. 
           DISPLAY "LOW/BLINK" LINE 7 POSITION 60.
           DISPLAY " WE ARE TESTING ALL THE "      
                LINE 9 POSITION 10 LOW REVERSE.
           DISPLAY "LOW/REVERSE VIDEO" LINE 9 POSITION 60.
           DISPLAY " DISPLAY OPTIONS "
                LINE 11 POSITION 10 LOW BLINK REVERSE.
           DISPLAY "LOW/REV/BLINK" LINE 11 POSITION 60.
           DISPLAY "ACCEPT WITH BLINK: " LINE 14 POSITION 10.
           ACCEPT NAME POSITION 0 BLINK.
           DISPLAY "LOW/REV W/PROMPT: " LINE 16 POSITION 10.
           ACCEPT NAME POSITION 0 PROMPT " " LOW REVERSE.
           DISPLAY "BLINK/REV  W/DEF PROMPT: " LINE 18 POSITION 10.
           ACCEPT NAME POSITION 0 PROMPT BLINK REVERSE.
           DISPLAY "HIT NEWLINE TO RETURN TO COMMAND MODE"
                LINE 20.
           ACCEPT ONE-CHAR POSITION 0.
           GO ENTER-COMMAND.
      /
       TEST-12-PARA.
           DISPLAY "ACCEPT WITH ON EXCEPTION CLAUSE (Ex. Ctrl-A)"
               LINE 1 ERASE.
       TEST-12-LOOP.
           DISPLAY "ENTER FIELD W/EXCEPTION CHARACTER" LINE 5 .
           DISPLAY "                       " LINE 8 POSITION 40.
           ACCEPT NAME LINE 7 POSITION 10 PROMPT
                   ON EXCEPTION EXC-NUM
                        DISPLAY "EXCEPTION BRANCH TAKEN" POSITION 40.
           DISPLAY NAME LINE 12 POSITION 10,
               " TERMINATED BY " POSITION 0,
               EXC-NUM POSITION 0.
           DISPLAY "ENTER EXCEPTION CHAR TO CONTINUE, C/R TO QUIT"
               LINE 20 POSITION 10.
           ACCEPT ONE-CHAR POSITION 0
                   ON EXCEPTION EXC-NUM2 GO TO TEST-12-LOOP.
           GO TO ENTER-COMMAND.
      *
       EXIT-PARA.
           EXIT PROGRAM.
       END PROGRAM.
