Define the data that you use in input and output operations in the FILE SECTION.
Provide the following information about the data:
Data items defined in the FILE SECTION are not available to PROCEDURE DIVISION statements until the file has been successfully opened.
Programs in the same run unit can share, or have access to, common files. The method for doing this depends on whether the programs are part of a nested (contained) structure or are separately compiled (including programs compiled as part of a batch sequence).
You can use the EXTERNAL clause for separately compiled programs. A file that is defined as EXTERNAL can be referenced by any program in the run unit that describes the file.
You can use the GLOBAL clause for programs in a nested, or contained, structure. If a program contains another program (directly or indirectly), both programs can access a common file by referencing a GLOBAL file-name.
related concepts
Nested programs
related tasks
Sharing files between programs (external files)
related references
FILE SECTION entries