$set mfoo Class-id. StudentPRT inherits from Base . Author. Arthur R. Buss Environment Division. Input-Output Section. File-Control. Select PrintFile Assign to printer "CON:" . Object Section. Class-control. Base is Class "base" StudentPRT is Class "senprt" . Data Division. File Section. fd PrintFile. 01 Print-Line pic X(45). FACTORY. Object-storage Section. 01 thePRTHandle object reference. Method-id. "New". Linkage Section. 01 ls-thePRTHandle object reference. Procedure Division returning ls-thePRTHandle. invoke super "New" returning thePRTHandle set ls-thePRTHandle to thePRTHandle invoke thePRTHandle "OpenPrinter" . End Method "New". End Factory. OBJECT. Method-id. "OpenPrinter". Procedure Division. open output PrintFile. invoke self "WriteHeader" . End Method "OpenPrinter". Method-id. "WriteHeader". Working-storage Section. 01 Heading-Line. 05 pic X(10) value Spaces. 05 Head-1 pic X(12) value "STUDENT NAME". 05 pic X(58) value Spaces. Procedure Division. move Heading-Line to Print-Line write Print-Line after advancing Page move Spaces to Print-Line write Print-Line after advancing 1 . End Method "WriteHeader". Method-id. "WriteDetail". Working-storage Section. 01 Detail-Line. 05 pic X(10) value Spaces. 05 Print-Name pic X(25). 05 pic X(45) value Spaces. Linkage Section. 01 ls-Stu-Name pic X(25). Procedure Division using ls-Stu-Name. move ls-Stu-Name to Print-Name move Detail-Line to Print-Line write Print-Line after advancing 1 . End Method "WriteDetail". Method-id. "FinalizeReport". Procedure Division. invoke self "WriteDetail" using " " invoke self "WriteDetail" using "* * * End of Report * * *" close PrintFile . End Method "FinalizeReport". End Object. End Class StudentPRT.