$set mfoo Class-id. StudentDM inherits from Base . Author. Arthur R. Buss - Environment Division. Input-Output Section. File-Control. Select Student-File Assign to "A:\chaptr20\Student.Dat" Organization is Line Sequential. Object section. Class-control. Base is class "Base" StudentDM is class "sendbi" Student is class "senstu" . Data Division. File Section. fd Student-File. 01 Student-In. 05 Stu-Name pic X(25). 05 Stu-Credits pic 9(03). 05 Stu-Major pic X(20). FACTORY. Object-storage Section. 01 Handles object reference. 05 theDBIHandle. Method-id. "New". Linkage Section. 01 ls-theDBIHandle object reference. Procedure Division returning ls-theDBIHandle. invoke super "New" returning ls-theDBIHandle open input Student-file . End Method "New". End Factory. OBJECT. Method-id. "ReadRecord". Linkage Section. 01 ls-Data-Remains-Switch pic X(03). Procedure Division returning ls-Data-Remains-Switch. Move "YES" to ls-Data-Remains-Switch Read Student-File at end move "NO" to ls-Data-Remains-Switch close Student-File end-Read . End Method "ReadRecord". Method-id. "GetStudent". Local-storage Section. 01 Student-Found pic X(03). 01 Data-Remains-Switch pic X(03). Linkage Section. 01 ls-Stu-Parameters. 05 ls-Stu-Credits pic 9(03). 05 ls-Stu-Major pic X(20). 01 ls-theStuHandle object reference. Procedure Division using ls-Stu-Parameters returning ls-theStuHandle. set ls-theStuHandle to null invoke self "ReadRecord" returning Data-Remains-Switch perform until Data-Remains-Switch = "NO" or ls-theStuHandle Not = null evaluate Stu-Credits also Stu-Major when >= ls-Stu-Credits also = ls-Stu-Major invoke self "CreateStudent" returning ls-theStuHandle when other invoke self "ReadRecord" returning Data-Remains-Switch end-evaluate end-perform . End Method "GetStudent". Method-id. "CreateStudent". Linkage Section. 01 ls-theStudentHandle object reference. Procedure Division returning ls-theStudentHandle. invoke Student "New" returning ls-theStudentHandle invoke ls-theStudentHandle "PopulateStudent" using Student-In . End Method "CreateStudent". End Object. End Class StudentDM.