MF 

Object-Storage Section

The Object-Storage Section is an optional section of the Data Division that enables you to declare class object data and instance object data.

Format


Syntax for Format for Object-Storage Section

Syntax Rules

  1. Data declared in the Object-Storage Section of the class object may only be accessed in class methods.
  2. Data declared in the Object-Storage Section of an object-program may only be accessed in instance methods.
  3. If DATA IS RESTRICTED or DATA IS PROTECTED is specified in the CLASS-ID paragraph, data declared in the Object-Storage Section may be directly accessed in a subclass. Otherwise, this data may only be accessed by invoking methods.
  4. The syntax rules for data declared in the Object-Storage Section are the same as those for the Linkage Section except you must not specify the DEPENDING ON phrase on an OCCURS clause when the ODOSLIDE Compiler directive is specified.

General Rules

  1. Data declared in the Object-Storage Section can be inherited by subclasses.
  2. Each new instance object is allocated its own unique storage for data items declared in the Object-Storage Section.
  3. When the Compiler directive OOCTRL(+W) is specified, the Working-Storage Section is treated as the Object-Storage Section.