METHODDEFAULT

Sets the default method for passing parameters.
Restriction: This directive is supported for managed COBOL only.

Syntax:

>>-.---.--METHOD-DEFAULT"pass-method"---------><
   +-/-+ 

Parameters:

pass-method
One of:
value
By default, pass parameters by value, unless BY REFERENCE is explicitly stated.
reference
By default, pass parameters by reference, unless BY VALUE is explicitly stated.

Properties:

Default: METHODDEFAULT"reference"
Phase: Both
$SET: Initial

Comments:

Parameters are passed by reference by default, except in extension methods where they are passed by value.

When specifying multiple value parameters, the keyword VALUE is assumed for subsequent consecutive parameters. In the following example, v and vv are passed by value, and the others are passed by reference:

procedure division using a as binary-long
                   value v as binary-long
                         vv as binary-long
                   reference r as binary-long
                         rr as binary-long.