       IDENTIFICATION DIVISION.
       PROGRAM-ID. DCJB8PGE.
       AUTHOR. ANDREW MAYNE.

       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       DATA DIVISION.
       WORKING-STORAGE SECTION.

      * COPY INQUIRY MAP LAYOUT
       COPY 'DCJB8MR'.

      * COPY ACCTFILE RECORD LAYOUT
       COPY 'STUDATA'.

       01 WS-STU-LENGTH-CONST PIC 9 VALUE 4.
       01 WS-COURSE-COUNTER PIC 9 VALUE 0.
       01 WS-MSG            PIC X(40).

       01 Cr1I PIC 9 VALUE 2.
       01 Cr2I PIC 9 VALUE 3.
       01 Cr3I PIC 9 VALUE 4.
       01 Cr4I PIC 9 VALUE 5.

       01 WS-ERRORCODE-CONSTS.
           05 ERRNUMBER PIC 99 VALUE 1.
           05 ERRCOURSE1A PIC 99 VALUE 2.
           05 ERRCOURSE2A PIC 99 VALUE 3.
           05 ERRCOURSE3A PIC 99 VALUE 4.
           05 ERRCOURSE4A PIC 99 VALUE 5.
           05 ERRCOURSE5A PIC 99 VALUE 6.
           05 ERRCOURSE1B PIC 99 VALUE 7.
           05 ERRCOURSE2B PIC 99 VALUE 8.
           05 ERRCOURSE3B PIC 99 VALUE 9.
           05 ERRCOURSE4B PIC 99 VALUE 10.
           05 ERRCOURSE5B PIC 99 VALUE 11.
           05 ERRNAME PIC 99 VALUE 12.
           05 ERRADD1 PIC 99 VALUE 13.
           05 ERRADD2 PIC 99 VALUE 14.
           05 ERRPOS1 PIC 99 VALUE 15.
           05 ERRPOS2 PIC 99 VALUE 16.
           05 ERRPHN1  PIC 99 VALUE 17.
           05 ERRPHN2  PIC 99 VALUE 18.
           05 ERRPHN3  PIC 99 VALUE 19.

       01 WS-COURSE-ARRAY.
          05 WS-COURSES OCCURS 5 TIMES.
             10 WS-CODES PIC X(8).

       01 WS-ALPHA PIC X.
           88 CAPITAL VALUE 'A' THRU 'Z'.

       01 I PIC 99 VALUE 0.
       01 WS-VALID-COUNT PIC 99 VALUE 0.

       01 WS-COURSE-CODE-1.
           05 WS-COURSE-CODE-1A  PIC X(4).
           05 WS-COURSE-CODE-1B  PIC X(4).

       01 WS-COURSE-CODE-2.
           05 WS-COURSE-CODE-2A  PIC X(4).
           05 WS-COURSE-CODE-2B  PIC X(4).

       01 WS-COURSE-CODE-3.
           05 WS-COURSE-CODE-3A  PIC X(4).
           05 WS-COURSE-CODE-3B  PIC X(4).

       01 WS-COURSE-CODE-4.
           05 WS-COURSE-CODE-4A  PIC X(4).
           05 WS-COURSE-CODE-4B  PIC X(4).

       01 WS-COURSE-CODE-5.
           05 WS-COURSE-CODE-5A  PIC X(4).
           05 WS-COURSE-CODE-5B  PIC X(4).

       LINKAGE SECTION.

       01 DFHCOMMAREA PIC X(400).


       PROCEDURE DIVISION.

           MOVE DFHCOMMAREA TO STUDATA-RECORD.

      *    MOVE "ERROR TEST" TO WS-MSG.
      *    MOVE 01 TO STU-ERRORCODE.
      *    GO TO 400-SEND-ERROR.


      * Validates for now
           IF STU-NUMBERL-T < 7
              MOVE 'STUDENT NUMBER MUST BE 7 CHARACTERS' TO WS-MSG
              MOVE ERRNUMBER TO STU-ERRORCODE OF STUDATA-RECORD
              GO TO 400-SEND-ERROR
           ELSE IF STU-NUMBERI-T IS NOT NUMERIC
              MOVE 'STUDENT NUMBER MUST BE NUMBERIC' TO WS-MSG
              MOVE ERRNUMBER TO STU-ERRORCODE OF STUDATA-RECORD
              GO TO 400-SEND-ERROR
           END-IF
           END-IF.

           IF (STU-CR1AL-T > 0 OR STU-CR1BL-T > 0)
              IF (STU-CR1AL-T < WS-STU-LENGTH-CONST)
                 PERFORM 700-COURSE1-LENGTH-RESPONSE
              ELSE IF (STU-CR1BL-T < WS-STU-LENGTH-CONST)
                 PERFORM 710-COURSE1-LENGTH-RESPONSE
              ELSE IF (STU-CR1AI-T IS NOT ALPHABETIC)
                 PERFORM 720-COURSE1-FORMAT-RESPONSE
              ELSE IF (STU-CR1BI-T IS NOT NUMERIC)
                 PERFORM 730-COURSE1-FORMAT-RESPONSE
           END-IF
           END-IF
           END-IF
           END-IF
           ELSE
              ADD 1 TO WS-COURSE-COUNTER
           END-IF.

      *    MOVE STUCR2AL TO STU-CR2AL-T
      *    MOVE STUCR2BL TO STU-CR2BL-T
      *    MOVE STUCR2AI TO STU-CR2AI-T
      *    MOVE STUCR2BI TO STU-CR2BI-T

           IF (STU-CR2AL-T > 0 OR STU-CR2BL-T > 0)
              IF (STU-CR2AL-T < WS-STU-LENGTH-CONST)
                 PERFORM 701-COURSE2-LENGTH-RESPONSE
              ELSE IF (STU-CR2BL-T < WS-STU-LENGTH-CONST)
                 PERFORM 711-COURSE2-LENGTH-RESPONSE
              ELSE IF (STU-CR2AI-T IS NOT ALPHABETIC)
                  PERFORM 721-COURSE2-FORMAT-RESPONSE
              ELSE IF (STU-CR2BI-T IS NOT NUMERIC)
                  PERFORM 731-COURSE2-FORMAT-RESPONSE
           END-IF
           END-IF
           END-IF
           END-IF
           ELSE
              ADD 1 TO WS-COURSE-COUNTER
           END-IF.

      *    MOVE STUCR3AL TO STU-CR3AL-T
      *    MOVE STUCR3BL TO STU-CR3BL-T
      *    MOVE STUCR3AI TO STU-CR3AI-T
      *    MOVE STUCR3BI TO STU-CR3BI-T

           IF (STU-CR3AL-T > 0 OR STU-CR3BL-T > 0)
              IF (STU-CR3AL-T < WS-STU-LENGTH-CONST)
                 PERFORM 702-COURSE3-LENGTH-RESPONSE
              ELSE IF (STU-CR3BL-T < WS-STU-LENGTH-CONST)
                 PERFORM 712-COURSE3-LENGTH-RESPONSE
              ELSE IF (STU-CR3AI-T IS NOT ALPHABETIC)
                  PERFORM 722-COURSE3-FORMAT-RESPONSE
              ELSE IF (STU-CR3BI-T IS NOT NUMERIC)
                  PERFORM 732-COURSE3-FORMAT-RESPONSE
           END-IF
           END-IF
           END-IF
           END-IF
           ELSE
              ADD 1 TO WS-COURSE-COUNTER
           END-IF.

      *    MOVE STUCR4AL TO STU-CR4AL-T
      *    MOVE STUCR4BL TO STU-CR4BL-T
      *    MOVE STUCR4AI TO STU-CR4AI-T
      *    MOVE STUCR4BI TO STU-CR4BI-T

           IF (STU-CR4AL-T > 0 OR STU-CR4BL-T > 0)
              IF (STU-CR4AL-T < WS-STU-LENGTH-CONST)
                 PERFORM 703-COURSE4-LENGTH-RESPONSE
              ELSE IF (STU-CR4BL-T < WS-STU-LENGTH-CONST)
                 PERFORM 713-COURSE4-LENGTH-RESPONSE
              ELSE IF (STU-CR4AI-T IS NOT ALPHABETIC)
                  PERFORM 723-COURSE4-FORMAT-RESPONSE
              ELSE IF (STU-CR4BI-T IS NOT NUMERIC)
                  PERFORM 733-COURSE4-FORMAT-RESPONSE
           END-IF
           END-IF
           END-IF
           END-IF
           ELSE
              ADD 1 TO WS-COURSE-COUNTER
           END-IF.

      *    MOVE STUCR5AL TO STU-CR5AL-T
      *    MOVE STUCR5BL TO STU-CR5BL-T
      *    MOVE STUCR5AI TO STU-CR5AI-T
      *    MOVE STUCR5BI TO STU-CR5BI-T

           IF (STU-CR5AL-T > 0 OR STU-CR5BL-T > 0)
              IF (STU-CR5AL-T < WS-STU-LENGTH-CONST)
                 PERFORM 704-COURSE5-LENGTH-RESPONSE
              ELSE IF (STU-CR5BL-T < WS-STU-LENGTH-CONST)
                 PERFORM 714-COURSE5-LENGTH-RESPONSE
              ELSE IF (STU-CR5AI-T IS NOT ALPHABETIC)
                  PERFORM 724-COURSE5-FORMAT-RESPONSE
              ELSE IF (STU-CR5BI-T IS NOT NUMERIC)
                  PERFORM 734-COURSE5-FORMAT-RESPONSE
           END-IF
           END-IF
           END-IF
           END-IF
           ELSE
              ADD 1 TO WS-COURSE-COUNTER
           END-IF.

           IF (WS-COURSE-COUNTER = 5)
              MOVE 'YOU MUST ADD AT LEAST ONE COURSE' TO WS-MSG
              MOVE ERRCOURSE1A TO STU-ERRORCODE OF STUDATA-RECORD
              GO TO 400-SEND-ERROR
           END-IF.

      * Array - moving stuff
           MOVE STU-CR1AI-T TO WS-COURSE-CODE-1A.
           MOVE STU-CR1BI-T TO WS-COURSE-CODE-1B.
           MOVE STU-CR2AI-T TO WS-COURSE-CODE-2A.
           MOVE STU-CR2BI-T TO WS-COURSE-CODE-2B.
           MOVE STU-CR3AI-T TO WS-COURSE-CODE-3A.
           MOVE STU-CR3BI-T TO WS-COURSE-CODE-3B.
           MOVE STU-CR4AI-T TO WS-COURSE-CODE-4A.
           MOVE STU-CR4BI-T TO WS-COURSE-CODE-4B.
           MOVE STU-CR5AI-T TO WS-COURSE-CODE-5A.
           MOVE STU-CR5BI-T TO WS-COURSE-CODE-5B.

           MOVE WS-COURSE-CODE-1 TO WS-COURSES(1)
           MOVE WS-COURSE-CODE-2 TO WS-COURSES(2)
           MOVE WS-COURSE-CODE-3 TO WS-COURSES(3)
           MOVE WS-COURSE-CODE-4 TO WS-COURSES(4)
           MOVE WS-COURSE-CODE-5 TO WS-COURSES(5)

      * Checking duplicates of arrays
           IF (WS-COURSE-CODE-1 IS NOT = SPACE AND LOW-VALUE)
              PERFORM VARYING Cr1I FROM Cr1I BY 1
              UNTIL (Cr1I > 5)
                   IF (WS-COURSES(1) = WS-COURSES(CR1I))
                   MOVE "COURSE CODE 1 HAS A DUPLICATE" TO WS-MSG
                   MOVE ERRCOURSE1A TO STU-ERRORCODE OF STUDATA-RECORD
                   GO TO 400-SEND-ERROR
                   END-IF
              END-PERFORM
           END-IF.

           IF (WS-COURSE-CODE-2 IS NOT = SPACE AND LOW-VALUE)
                PERFORM VARYING Cr2I FROM Cr2I BY 1
                UNTIL (Cr2I > 5)
                     IF (WS-COURSES(2) = WS-COURSES(CR2I))
                     MOVE "COURSE CODE 2 HAS A DUPLICATE" TO WS-MSG
                     MOVE ERRCOURSE2A TO STU-ERRORCODE OF STUDATA-RECORD
                     GO TO 400-SEND-ERROR
                     END-IF
                END-PERFORM
           END-IF.

           IF (WS-COURSE-CODE-3 IS NOT = SPACE AND LOW-VALUE)
                PERFORM VARYING Cr3I FROM Cr3I BY 1
                UNTIL (Cr3I > 5)
                     IF (WS-COURSES(3) = WS-COURSES(CR3I))
                     MOVE "COURSE CODE 3 HAS A DUPLICATE" TO WS-MSG
                     MOVE ERRCOURSE3A TO STU-ERRORCODE OF STUDATA-RECORD
                     GO TO 400-SEND-ERROR
                     END-IF
                END-PERFORM
           END-IF.

           IF (WS-COURSE-CODE-4 IS NOT = SPACE AND LOW-VALUE)
                PERFORM VARYING Cr4I FROM Cr4I BY 1
                UNTIL (Cr4I > 5)
                     IF (WS-COURSES(4) = WS-COURSES(CR4I))
                     MOVE "COURSE CODE 4 HAS A DUPLICATE" TO WS-MSG
                     MOVE ERRCOURSE4A TO STU-ERRORCODE OF STUDATA-RECORD
                     GO TO 400-SEND-ERROR
                     END-IF
                END-PERFORM
           END-IF.

      * TO-DO: Do a double loop for arrays to make it more dynamic
      *
      * 1 loop controls ws-courses on the left
      * 1 loop controls ws-courses on the right
      * For the right maybe have loop-right = loop-ctrl-left + 1
      * Perform switch statement to check which code has a duplicate
      * perform duplicate error that moves a lot of stuff
      * Im just glad this is working

      *    IF (STU-NAMEL-T = 0)
      *       MOVE 'YOU MUST INPUT STUDENT NAME' TO WS-MSG
      *       MOVE 01 TO STU-ERRORCODE OF STUDATA-RECORD
      *       GO TO 400-SEND-ERROR
      *    END-IF.

           MOVE STU-NAMEI-T(1:1) TO WS-ALPHA.

           IF (WS-ALPHA IS NOT ALPHABETIC OR NOT CAPITAL)
                MOVE 'FIRST LETTER MUST BE CAPTIZALIZED' TO WS-MSG
                MOVE ERRNAME TO STU-ERRORCODE OF STUDATA-RECORD
                GO TO 400-SEND-ERROR
           END-IF.

           PERFORM VARYING I FROM 1 BY 1
           UNTIL (I > STU-NAMEL-T)
      *    SPACES ARE ALPHABETICAL
                MOVE STU-NAMEI-T(I:1) TO WS-ALPHA
                IF (WS-ALPHA IS ALPHABETIC AND CAPITAL) THEN
                    ADD 1 TO WS-VALID-COUNT
                END-IF
           END-PERFORM.

      *         MOVE WS-VALID-COUNT TO WS-MSG.
      *         MOVE 01 TO STU-ERRORCODE OF STUDATA-RECORD.
      *         GO TO 400-SEND-ERROR.

           IF (WS-VALID-COUNT < 4)
                MOVE 'STUDENT NAME MUST HAVE 4 VALID LETTERS' TO WS-MSG
                MOVE ERRNAME TO STU-ERRORCODE OF STUDATA-RECORD
                GO TO 400-SEND-ERROR
           END-IF.

      *    MOVE STUADD1L TO STU-ADD1L-T

           IF (STU-ADD1L-T = 0)
               MOVE 'STUDENT ADDRESS ON LINE 1 IS REQUIRED' TO WS-MSG
               MOVE ERRADD1 TO STU-ERRORCODE OF STUDATA-RECORD
               GO TO 400-SEND-ERROR
           END-IF.

      *    MOVE STUADD2L TO STU-ADD2L-T

           IF (STU-ADD2L-T = 0)
               MOVE 'STUDENT ADDRESS ON LINE 2 IS REQUIRED' TO WS-MSG
               MOVE ERRADD2 TO STU-ERRORCODE OF STUDATA-RECORD
               GO TO 400-SEND-ERROR
           END-IF.

      *    MOVE STUPOS1L TO STU-POST1L-T
      *    MOVE STUPOS1I TO STU-POST1I-T

           IF STU-POST1L-T < 3
              MOVE 'POSTAL CODE MUST BE 6 CHARACTERS LONG' TO WS-MSG
              MOVE ERRPOS1 TO STU-ERRORCODE OF STUDATA-RECORD
              GO TO 400-SEND-ERROR
           ELSE IF STU-POST1I-T(1:1) IS NUMERIC
                MOVE 'POSTAL: FIRST INPUT MUST BE A LETTER' TO WS-MSG
                MOVE ERRPOS1 TO STU-ERRORCODE OF STUDATA-RECORD
                GO TO 400-SEND-ERROR
           ELSE IF (STU-POST1I-T(2:1) IS NOT NUMERIC)
                MOVE 'POSTAL: SECOND INPUT MUST BE A NUMBER' TO WS-MSG
                MOVE ERRPOS1 TO STU-ERRORCODE OF STUDATA-RECORD
                GO TO 400-SEND-ERROR
           ELSE IF (STU-POST1I-T(3:1) IS NUMERIC)
                MOVE 'POSTAL: THIRD INPUT MUST BE A LETTER' TO WS-MSG
                MOVE ERRPOS1 TO STU-ERRORCODE OF STUDATA-RECORD
                GO TO 400-SEND-ERROR
           END-IF
           END-IF
           END-IF
           END-IF.

      *    MOVE STUPOS2L TO STU-POST2L-T
      *    MOVE STUPOS2I TO STU-POST2I-T

           IF STU-POST2L-T < 3
              MOVE 'POSTAL CODE MUST BE 6 CHARACTERS LONG' TO WS-MSG
              MOVE ERRPOS2 TO STU-ERRORCODE OF STUDATA-RECORD
              GO TO 400-SEND-ERROR
           ELSE IF STU-POST2I-T(1:1) IS NOT NUMERIC
                MOVE 'POSTAL: FOURTH INPUT MUST BE A NUMBER' TO WS-MSG
                MOVE ERRPOS2 TO STU-ERRORCODE OF STUDATA-RECORD
                GO TO 400-SEND-ERROR
           ELSE IF STU-POST2I-T(2:1) IS NUMERIC
                MOVE 'POSTAL: FIFTH INPUT MUST BE A LETTER' TO WS-MSG
                MOVE ERRPOS2 TO STU-ERRORCODE OF STUDATA-RECORD
                GO TO 400-SEND-ERROR
           ELSE IF (STU-POST2I-T(3:1) IS NOT NUMERIC)
                MOVE 'POSTAL: SIXTH INPUT MUST BE A NUMBER' TO WS-MSG
                MOVE ERRPOS2 TO STU-ERRORCODE OF STUDATA-RECORD
                GO TO 400-SEND-ERROR
           END-IF
           END-IF
           END-IF
           END-IF.

      *    MOVE STUPHN1L TO STU-PHN1L-T
      *    MOVE STUPHN1I TO STU-PHN1I-T

           IF STU-PHN1L-T < 3
              MOVE 'PHONE NUMBER MUST BE 10 DIGITS LONG' TO WS-MSG
              MOVE ERRPHN1 TO STU-ERRORCODE OF STUDATA-RECORD
              GO TO 400-SEND-ERROR
           ELSE IF STU-PHN1I-T IS NOT NUMERIC
              MOVE 'PHONE NUMBER MUST BE NUMERIC' TO WS-MSG
              MOVE ERRPHN1 TO STU-ERRORCODE OF STUDATA-RECORD
              GO TO 400-SEND-ERROR
           END-IF
           END-IF.

      *    MOVE STUPHN2L TO STU-PHN2L-T
      *    MOVE STUPHN2I TO STU-PHN2I-T

           IF STU-PHN2L-T < 3
              MOVE 'PHONE NUMBER MUST BE 10 DIGITS LONG' TO WS-MSG
              MOVE ERRPHN2 TO STU-ERRORCODE OF STUDATA-RECORD
              GO TO 400-SEND-ERROR
           ELSE IF STU-PHN2I-T IS NOT NUMERIC
              MOVE 'PHONE NUMBER MUST BE NUMERIC' TO WS-MSG
              MOVE ERRPHN2 TO STU-ERRORCODE OF STUDATA-RECORD
              GO TO 400-SEND-ERROR
           END-IF
           END-IF.

      *    MOVE STUPHN3L TO STU-PHN3L-T
      *    MOVE STUPHN3I TO STU-PHN3I-T

           IF STU-PHN3L-T < 4
              MOVE 'PHONE NUMBER MUST BE 10 DIGITS LONG' TO WS-MSG
              MOVE ERRPHN3 TO STU-ERRORCODE OF STUDATA-RECORD
              GO TO 400-SEND-ERROR
           ELSE IF STU-PHN3I-T IS NOT NUMERIC
              MOVE 'PHONE NUMBER MUST BE NUMERIC' TO WS-MSG
              MOVE ERRPHN3 TO STU-ERRORCODE OF STUDATA-RECORD
              GO TO 400-SEND-ERROR
           END-IF
           END-IF.

           MOVE 00 to STU-ERRORCODE OF STUDATA-RECORD
      * IF THERE ARE NO ERRORS SEND SPACES INTO DFHCOMMAREA AND EXIT
           MOVE STUDATA-RECORD TO DFHCOMMAREA.
      * Always need to move studata-record back to dfhcommarea at the
      * end of this program for linking
           EXEC CICS RETURN END-EXEC.

      *300-DUPREC.
      *
      *    MOVE LOW-VALUES TO MAP1O.
      *    MOVE 'STUDENT ALREADY EXISTS' TO MSGO.
      *
      *    EXEC CICS SEND
      *         MAP('MAP1')
      *         MAPSET('DCJB8MC')
      *    END-EXEC.
      *
      *    EXEC CICS RETURN
      *         TRANSID('JB82')
      *    END-EXEC.

       700-COURSE1-LENGTH-RESPONSE.

           MOVE 'COURSE CODE 1 MUST HAVE 8 CHARACTERS' TO WS-MSG.
           MOVE ERRCOURSE1A TO STU-ERRORCODE OF STUDATA-RECORD.
           GO TO 400-SEND-ERROR.

       710-COURSE1-LENGTH-RESPONSE.

           MOVE 'COURSE CODE 1 MUST HAVE 8 CHARACTERS' TO WS-MSG.
           MOVE ERRCOURSE1B TO STU-ERRORCODE OF STUDATA-RECORD.
           GO TO 400-SEND-ERROR.

       701-COURSE2-LENGTH-RESPONSE.

           MOVE 'COURSE CODE 2 MUST HAVE 8 CHARACTERS' TO WS-MSG.
           MOVE ERRCOURSE2A TO STU-ERRORCODE OF STUDATA-RECORD.
           GO TO 400-SEND-ERROR.

       711-COURSE2-LENGTH-RESPONSE.

           MOVE 'COURSE CODE 2 MUST HAVE 8 CHARACTERS' TO WS-MSG.
           MOVE ERRCOURSE2B TO STU-ERRORCODE OF STUDATA-RECORD.
           GO TO 400-SEND-ERROR.

       702-COURSE3-LENGTH-RESPONSE.

           MOVE 'COURSE CODE 3 MUST HAVE 8 CHARACTERS' TO WS-MSG.
           MOVE ERRCOURSE3A TO STU-ERRORCODE OF STUDATA-RECORD.
           GO TO 400-SEND-ERROR.

       712-COURSE3-LENGTH-RESPONSE.

           MOVE 'COURSE CODE 3 MUST HAVE 8 CHARACTERS' TO WS-MSG.
           MOVE ERRCOURSE3A TO STU-ERRORCODE OF STUDATA-RECORD.
           GO TO 400-SEND-ERROR.

       703-COURSE4-LENGTH-RESPONSE.

           MOVE 'COURSE CODE 4 MUST HAVE 8 CHARACTERS' TO WS-MSG.
           MOVE ERRCOURSE4A TO STU-ERRORCODE OF STUDATA-RECORD.
           GO TO 400-SEND-ERROR.

       713-COURSE4-LENGTH-RESPONSE.

           MOVE 'COURSE CODE 4 MUST HAVE 8 CHARACTERS' TO WS-MSG.
           MOVE ERRCOURSE4B TO STU-ERRORCODE OF STUDATA-RECORD.
           GO TO 400-SEND-ERROR.

       704-COURSE5-LENGTH-RESPONSE.

           MOVE 'COURSE CODE 5 MUST HAVE 8 CHARACTERS' TO WS-MSG.
           MOVE ERRCOURSE5A TO STU-ERRORCODE OF STUDATA-RECORD.
           GO TO 400-SEND-ERROR.

       714-COURSE5-LENGTH-RESPONSE.

           MOVE 'COURSE CODE 5 MUST HAVE 8 CHARACTERS' TO WS-MSG.
           MOVE ERRCOURSE5B TO STU-ERRORCODE OF STUDATA-RECORD.
           GO TO 400-SEND-ERROR.

       720-COURSE1-FORMAT-RESPONSE.

           MOVE 'COURSE CODE 1 WRONG FORMAT, XXXX 9999' TO WS-MSG.
           MOVE ERRCOURSE1A TO STU-ERRORCODE OF STUDATA-RECORD.
           GO TO 400-SEND-ERROR.

       730-COURSE1-FORMAT-RESPONSE.

           MOVE 'COURSE CODE 1 WRONG FORMAT, XXXX 9999' TO WS-MSG.
           MOVE ERRCOURSE1B TO STU-ERRORCODE OF STUDATA-RECORD.
           GO TO 400-SEND-ERROR.

       721-COURSE2-FORMAT-RESPONSE.

           MOVE 'COURSE CODE 2 WRONG FORMAT, XXXX 9999' TO WS-MSG.
           MOVE ERRCOURSE2A TO STU-ERRORCODE OF STUDATA-RECORD.
           GO TO 400-SEND-ERROR.

       731-COURSE2-FORMAT-RESPONSE.

           MOVE 'COURSE CODE 2 WRONG FORMAT, XXXX 9999' TO WS-MSG.
           MOVE ERRCOURSE2B TO STU-ERRORCODE OF STUDATA-RECORD.
           GO TO 400-SEND-ERROR.

       722-COURSE3-FORMAT-RESPONSE.

           MOVE 'COURSE CODE 3 WRONG FORMAT, XXXX 9999' TO WS-MSG.
           MOVE ERRCOURSE3A TO STU-ERRORCODE OF STUDATA-RECORD.
           GO TO 400-SEND-ERROR.

       732-COURSE3-FORMAT-RESPONSE.

           MOVE 'COURSE CODE 3 WRONG FORMAT, XXXX 9999' TO WS-MSG.
           MOVE ERRCOURSE3B TO STU-ERRORCODE OF STUDATA-RECORD.
           GO TO 400-SEND-ERROR.

       723-COURSE4-FORMAT-RESPONSE.

           MOVE 'COURSE CODE 4 WRONG FORMAT, XXXX 9999' TO WS-MSG.
           MOVE ERRCOURSE4A TO STU-ERRORCODE OF STUDATA-RECORD.
           GO TO 400-SEND-ERROR.

       733-COURSE4-FORMAT-RESPONSE.

           MOVE 'COURSE CODE 4 WRONG FORMAT, XXXX 9999' TO WS-MSG.
           MOVE ERRCOURSE4B TO STU-ERRORCODE OF STUDATA-RECORD.
           GO TO 400-SEND-ERROR.

       724-COURSE5-FORMAT-RESPONSE.

           MOVE 'COURSE CODE 5 WRONG FORMAT, XXXX 9999' TO WS-MSG.
           MOVE ERRCOURSE5A TO STU-ERRORCODE OF STUDATA-RECORD.
           GO TO 400-SEND-ERROR.

       734-COURSE5-FORMAT-RESPONSE.

           MOVE 'COURSE CODE 5 WRONG FORMAT, XXXX 9999' TO WS-MSG.
           MOVE ERRCOURSE5B TO STU-ERRORCODE OF STUDATA-RECORD.
           GO TO 400-SEND-ERROR.

       400-SEND-ERROR.
           MOVE WS-MSG TO STU-ERRORMSG OF STUDATA-RECORD.
           MOVE STUDATA-RECORD TO DFHCOMMAREA.
           EXEC CICS RETURN END-EXEC.

       END PROGRAM DCJB8PGE.
