A file specified in an instance object means that the instance definition contains the FILE-CONTROL paragraph and the file section. One or more instance methods will contain the file processing statements such as OPEN, CLOSE, READ and WRITE. All of the instance methods have visibility to the records associated with the file.When a class that contains a file specified in the instance definition is inherited, each direct or indirect descendent also inherits the file specification. The instance objects of each of these subclasses have their own file connector unless the EXTERNAL clause is specified for the file. Dynamic file assignment or file sharing may be used to resolve conflicts in accessing the physical files associated with these file connectors.Sample code for dynamic file assignment is illustrated below. Note that the MOVE statements only have an effect on the dynamic assignment when a subsequent OPEN statement for the file connector is executed.
CLASS-ID. Employee INHERITS Base.DATA DIVISION.FILE SECTION.FD EMPLOYEE-FILEWORKING-STORAGE SECTION.PROCEDURE DIVISION.METHOD-ID. readFile.WORKING-STORAGE SECTION.01 EMPLRCD.PROCEDURE DIVISION.
| Copyright (c) 2017 Veryant |
| Contact us |
|
Please share your comments on this manual or on any Veryant product documentation with the email button at the top left |