wStudentRecords

    READ StudentRecords
       AT END SET EndOfStudentFile TO TRUE
    END-READ

    READ TransRecords
       AT END SET EndOfTransFile TO TRUE
    END-READ

    PERFORM UNTIL (EndOfStudentFile) AND (EndOfTransFile)
       EVALUATE TRUE
         WHEN (StudentID < TransStudentID)
              WRITE NewStudentRecord FROM StudentRecord
              READ StudentRecords
                 AT END SET EndOfStudentFile TO TRUE
              END-READ

         WHEN (StudentID > Tra