      $set repository(update on checking on)
123456 class-id. Vehicle inherits from Base.
    
       repository.
           class Vehicle
           class Base as "base"
           class CharString as "String"
           .

       factory.

       method-id. "newVehicle".
       linkage section.
       1 lk-type     pic x any length.
       1 lk-wheels   binary-char unsigned.
       1 lk-obj-ref  usage object reference active-class.
       procedure division using lk-type lk-wheels returning lk-obj-ref.
           invoke super "new" returning lk-obj-ref
           invoke lk-obj-ref "initvehicle" using lk-type lk-wheels
           exit method.
       end method "newVehicle".

       end factory.

       object.
       working-storage section.
       1 v-wheels binary-char unsigned property no set.
       1 v-type   usage object reference CharString.

       method-id. "initVehicle".
       linkage section.
       1 lk-wheels   binary-char unsigned.
       1 lk-type     pic x any length.
       procedure division using lk-type lk-wheels.
           set v-type to CharString::"newstring"(lk-type)
           move lk-wheels to v-wheels
           exit method.
       end method "initVehicle".

       method-id. "display".
       procedure division.
           display "Vehicle type: " with no advancing
           invoke v-type "displaynl"
           display "Number of wheels:" v-wheels 
           exit method
       end method "display".
       
       end object.

       end class Vehicle.
       
       
