Filename Conventions

A file is identified in a COBOL program by a filename which is a user-defined word. Outside the COBOL system it is identified by a filename which must be in an external, operating-system format. There are four components:

  • A drive
  • A path
  • A base-name
  • An extension

The maximum length of the filename is 259 characters (Windows) and 1023 characters (UNIX).

COBOL imposes no other limits, but in order for the operating system to handle the filename correctly, any operating system limits must be observed when the program is run.

The following restrictions apply when naming your files: