Rational Developer for System z
COBOL for Windows, Version 7.5, Language Reference


OBJECT REFERENCE phrase

A data item defined with the OBJECT REFERENCE phrase is an object reference.

class-name-1
An optional class name.

You must declare class-name-1 in the REPOSITORY paragraph in the configuration section of the containing class or outermost program.

If specified, class-name-1 indicates that data-name-1 always refers to an object-instance of class class-name-1 or a class derived from class-name-1.

Important: The programmer must ensure that the referenced object meets this requirement; violations are not diagnosed.

If class-name-1 is not specified, the object reference can refer to an object of any class. In this case, data-name-1 is a universal object reference.

You can specify data-name-1 within an alphanumeric group item without affecting the semantics of the group item. There is no conversion of values or other special handling of the object references when statements are executed that operate on the group. The group continues to behave as an alphanumeric group item.

An object reference can be defined in any section of the data division of a factory definition, object definition, method, or program. An object-reference data item can be used in only:

Object-reference data items:

A VALUE clause for an object-reference data item can contain only NULL or NULLS.

You can use the SYNCHRONIZED clause with the USAGE OBJECT REFERENCE clause to obtain efficient alignment of the object-reference data item.

The DATE FORMAT, JUSTIFIED, PICTURE, and BLANK WHEN ZERO clauses cannot be used to describe group or elementary items defined with the USAGE OBJECT REFERENCE clause.


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)