SEPOBJ

SEPOBJ specifies whether each of the outermost COBOL programs in a batch compilation is to be generated as a separate object file rather than as a single object file.

SEPOBJ option syntax

Read syntax diagramSkip visual syntax diagramSEPOBJNOSEPOBJ

Default is: SEPOBJ

Abbreviations are: None

Batch compilation

When multiple outermost programs (nonnested programs) are compiled with a single batch invocation of the compiler, the number of files produced for the object program output of the batch compilation depends on the compiler option SEPOBJ.

Assume that the COBOL source file pgm.cbl contains three outermost COBOL programs named pgm1, pgm2, and pgm3. The following figures illustrate whether the object program output is generated as one file (with NOSEPOBJ) or three files (with SEPOBJ).

Batch compilation with NOSEPOBJ

Using NOSEPOBJ results in the three programs being output in one file, pgm.o.

Batch compilation with SEPOBJ

Using SEPOBJ results in the three programs being output in three files: pgm.o, pgm2.o, and pgm3.o.

Usage notes

  • The SEPOBJ option is required to conform to 85 COBOL Standard where pgm2 or pgm3 in the above example is called using CALL identifier from another program.
  • If NOSEPOBJ is in effect, the object files are given the name of the source file but with suffix .o. If SEPOBJ is in effect, the names of the object files are based on the PROGRAM-ID name with suffix .o.
  • The programs called using CALL identifier must be referred to by the names of the object files (rather than the PROGRAM-ID names) where PROGRAM-ID and the object file name do not match.

You must give the object file a valid file-name for the platform and the file system.