INPUT-OUTPUT SECTION for defining a class instance method
The ENVIRONMENT DIVISION
of an instance method can
have only
one section, the INPUT-OUTPUT SECTION
. This section
relates the file-names
used in a method definition to the corresponding file-names as they
are known to the operating system.
About this task
For example, if the Account class defined a method that read
information from a file, the Account class might have an INPUT-OUTPUT
SECTION
that is coded like this:
Environment Division.
Input-Output Section.
File-Control.
Select account-file Assign AcctFile.
The syntax for the INPUT-OUTPUT SECTION
of a method
is the same as the syntax
for the INPUT-OUTPUT SECTION
of a program.