OBJECT-COMPUTER

Overview

The OBJECT-COMPUTER paragraph is used in the CONFIGURATION SECTION of the ENVIRONMENT DIVISION to specify characteristics of the computer on which the object program will be executed. It defines memory allocation, segment limits, and other execution environment parameters.

Syntax

OBJECT-COMPUTER. computer-name
    [MEMORY SIZE IS integer-1 {WORDS|CHARACTERS|MODULES}]
    [PROGRAM COLLATING SEQUENCE IS alphabet-name-1]
    [SEGMENT-LIMIT IS segment-number].

Parameters

ParameterDescription
computer-nameName of the target computer system
MEMORY SIZESpecifies memory allocation (largely obsolete in modern systems)
PROGRAM COLLATING SEQUENCEDefines character comparison sequence for the program
SEGMENT-LIMITThreshold for memory segmentation (0-99)

Examples

Basic OBJECT-COMPUTER Specification

ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-3090.
OBJECT-COMPUTER. IBM-3090.

Simple specification for target computer.

With Memory Size Specification

ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-MVS.
OBJECT-COMPUTER. IBM-MVS
    MEMORY SIZE IS 4096 WORDS.

Specifying memory size for the target computer.

With Collating Sequence

ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
    ALPHABET EBCDIC-SEQUENCE IS EBCDIC.
SOURCE-COMPUTER. IBM-Z.
OBJECT-COMPUTER. IBM-Z
    PROGRAM COLLATING SEQUENCE IS EBCDIC-SEQUENCE.

Defining collating sequence for character comparisons.

With Segment Limit

ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-Z15.
OBJECT-COMPUTER. IBM-Z15
    SEGMENT-LIMIT IS 49.

Setting segment limit for memory management.

Complete Specification

ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
    ALPHABET ASCII-SEQUENCE IS ASCII.
SOURCE-COMPUTER. IBM-MAINFRAME.
OBJECT-COMPUTER. IBM-MAINFRAME
    MEMORY SIZE IS 8192 CHARACTERS
    PROGRAM COLLATING SEQUENCE IS ASCII-SEQUENCE
    SEGMENT-LIMIT IS 32.

Full specification with all available options.

Usage Notes

  • The OBJECT-COMPUTER paragraph is optional in most modern COBOL implementations
  • Memory size specifications are largely ignored by modern compilers
  • Computer names can be any valid COBOL word but typically reflect the target system
  • Segment limits affect how procedures are organized in memory
  • Collating sequence affects comparison operations throughout the program

Segment Numbers

Segment RangeTypeDescription
0-49Fixed PermanentAlways remain in memory
50-99IndependentCan be overlaid in memory

Modern Considerations

Legacy vs. Modern Usage

  • Legacy: Memory management was critical in early systems
  • Modern: Most clauses are documentary only
  • Current: Focus on portability and standards compliance

Best Practices

  • Keep computer names descriptive and consistent across programs
  • Only specify collating sequence when non-standard ordering is required
  • Use segment limits judiciously for large programs
  • Document any special environment requirements
  • Test programs on target systems when possible

Related Concepts

SOURCE-COMPUTER

Specifies compilation environment characteristics

SPECIAL-NAMES

Defines implementation-specific names and features

CONFIGURATION SECTION

Container for environment specifications

ALPHABET Clause

Defines character sets and collating sequences