Conventions for Program-Names

The program-name of a program is specified in the PROGRAM-ID paragraph of the program's Identification Division. A program-name can be referenced only by the:
  • CALL statement
  • CANCEL statement
  • END PROGRAM header
  • IBM Extension
    IBM Extension SET statement End of IBM Extension
    End of IBM Extension

Names of programs constituting a run unit are not necessarily unique, but when two programs in a run unit are identically named, at least one of those two programs must be directly or indirectly contained within another separately compiled program which does not contain the other of those two programs.

The following rules regulate the scope of a program-name.
  • If the program-name is that of a program which does not possess the COMMON attribute and which is directly contained within another program, that program-name can be referenced only by statements included in that containing program.
  • If the program-name is that of a program which possesses the COMMON attribute and that is directly contained within another program, that program-name can be referenced only by statements included in that containing program and any programs directly or indirectly contained within that containing program, except that program possessing the COMMON attribute and any programs contained within it.
  • If the program-name is that of an outermost COBOL program in a separately compiled module object, that program-name can be referenced by statements included in any other program in the run unit, except programs it directly or indirectly contains.