nsStudentID)
              WRITE NewStudentRecord FROM TransRecord
              READ TransRecords
                  AT END SET EndOfTransFile TO TRUE
              END-READ

         WHEN (StudentID = TransStudentID)
              DISPLAY "Error - " TransStudentId " already exists in file"
              READ TransRecords
                  AT END SET EndOfTransFile TO TRUE
              END-READ
       END-EVALUATE
    END-PERFORM
    
    CLOSE StudentRecords
    CLOSE TransRecords
    CLOS