ISO2002 

The PROPERTY Clause

The PROPERTY clause indicates that this data item is a property of the object in which this data description is contained and that GET and/or SET methods are to be generated accordingly.

General Format


*

Syntax Rules

  1. The PROPERTY clause can be specified only in the Working-Storage Section of a factory definition or an object definition.
  2. The PROPERTY clause must not be specified for data items subordinate to an OCCURS clause.
  3. The PROPERTY clause can be specified only for an elementary item whose name does not require qualification for uniqueness of reference.
  4. The data-name for the subject of the entry must not be the same as a property-name defined in a superclass.
    Note: A property-name may be defined in a superclass either by defining a method or a pair of methods with the PROPERTY phrase or by describing a data description entry with the PROPERTY clause.

General Rules

  1. If the GET phrase is not specified, the PROPERTY clause causes a method to be defined for the containing factory or object.

    If the subject of this entry is of class index, object, or pointer, the implicit definition of this method is as follows:

     METHOD-ID. GET PROPERTY data-name. 
     DATA DIVISION. 
     LINKAGE SECTION. 
     01 LS-data-name data-description. 
     PROCEDURE DIVISION RETURNING LS-data-name. 
     par-name. 
         SET LS-data-name TO data-name 
         EXIT METHOD. 
     END METHOD. 

    If the subject of this entry is of category alphanumeric-edited, national-edited, or numeric-edited, the implicit definition of this method is as follows:

     METHOD-ID. GET PROPERTY data-name. 
     DATA DIVISION. 
     LINKAGE SECTION. 
     01 LS-data-name data-description. 
     PROCEDURE DIVISION RETURNING LS-data-name. 
     par-name. 
         MOVE data-name TO LS-data-name (1:). 
         EXIT METHOD. 
     END METHOD. 
    Note: If the subject of the entry is edited, reference modification of the receiving item as the whole of itself prevents the editing rules from being reapplied to the data.

    Otherwise, the implicit definition of this method is as follows:

     METHOD-ID. GET PROPERTY data-name.
     DATA DIVISION.
     LINKAGE SECTION.
     01 LS-data-name data-description.
     PROCEDURE DIVISION RETURNING LS-data-name.
     par-name.
         MOVE data-name TO LS-data-name
         EXIT METHOD.
     END METHOD. 

    where LS-data-name has the data description of the subject of the entry, including its subordinate items, with the exception of:

    • INDEXED BY phrases
    • PROPERTY clauses
    • VALUE clauses
    • a REDEFINES clause in the description of the subject of the entry.
  2. If the SET phrase is not specified, the PROPERTY clause causes a method to be defined for the containing factory or object.

    If the subject of this entry is of class index, object, or pointer, the implicit definition of this method is as follows:

     METHOD-ID. SET PROPERTY data-name.
     DATA DIVISION.
     LINKAGE SECTION.
     01 LS-data-name data-description.
     PROCEDURE DIVISION USING LS-data-name.
     par-name.
         SET data-name TO LS-data-name
         EXIT METHOD.
     END METHOD. 

    If the subject of this entry is of category alphanumeric-edited, national-edited, or numeric-edited, the implicit definition of this method is as follows:

     METHOD-ID. SET PROPERTY data-name.
     DATA DIVISION.
     LINKAGE SECTION.
     01 LS-data-name data-description.
     PROCEDURE DIVISION USING LS-data-name.
     par-name.
         MOVE LS-data-name TO data-name (1:).
         EXIT METHOD.
     END METHOD. 
    Note: If the subject of the entry is edited, reference modification of the receiving item as the whole of itself prevents the editing rules from being reapplied to the data.

    Otherwise, the implicit definition of this method is as follows:

     METHOD-ID. SET PROPERTY data-name.
     DATA DIVISION.
     LINKAGE SECTION.
     01 LS-data-name data-description.
     PROCEDURE DIVISION USING LS-data-name.
     par-name.
         MOVE LS-data-name TO data-name
         EXIT METHOD.
     END METHOD. 

    where LS-data-name has the data description of the subject of the entry, including its subordinate items, with the exception of:

    • INDEXED BY phrases
    • PROPERTY clauses
    • VALUE clauses
    • A REDEFINES clause in the description of the subject of the entry.