skip to main content

Procedure Division : Procedure division structure

Procedure division structure
General format
Syntax rules
1.
Data-Name-1, Data-Name-2, Class-Name-1, Interface-Name-1, Section-Name-1, Section-Name-2, Paragraph-Name-1, Paragraph-Name-2, Paragraph-Name-3 and Paragraph-Name-4 are User-defined words, as defined in the Definitions section in the Preface of this document.
2.
Data-name-1 shall be defined as a level 01 entry or a level 77 entry in the linkage section. A particular user-defined word shall not appear more than once as data-name-1.
3.
The RETURNING phrase may be specified only in a method definition.
4.
The RAISING phrase may be specified only in a method definition.
5.
Class-Name-1 shall be the name of a class specified in the REPOSITORY Paragraph in the Configuration Section of the ENVIRONMENT DIVISION.
6.
Interface-Name-1 shall be the name of a class specified in the REPOSITORY Paragraph in the Configuration Section of the ENVIRONMENT DIVISION.
7.
BY VALUE and BY REFERENCE are treated as a commentary.
8.
If USING is used, Data-Name-1 must be declared in the program Linkage Section. If CHAINING is used, Data-Name-1 must be declared in the program Working-Storage Section or File Section.
General rules
1.
2.
The USING phrase identifies the formal parameters used by the method or program for any arguments passed to it. The arguments passed from the activating element are:
the arguments specified in the USING phrase of a CALL Statement
the arguments specified in the USING phrase of a CHAIN Statement
the arguments specified in the USING phrase of an INVOKE Statement
 
The correspondence between the arguments and the formal parameters is established on a positional basis.
 
The conformance requirements for formal parameters and returning items are specified in Conformance for parameters and returning items.
3.
Data-Name-2 is the name used in the function, method, or program for the result that is returned to the activating element according to the Results of runtime element execution.
4.
5.
 
If the activated runtime element is a method, then this allocated record is
 
The argument is used as the sending operand and the allocated record as the receiving operand in the following:
if the formal parameter is numeric, a COMPUTE Statement without the ROUNDED phrase
 
The allocated record is then treated as if it were the argument and it were passed by reference.
6.
At all times in the activated element, references to data-name-1 and to data-name-2 are resolved in accordance with their description in the linkage section.
7.
If class-name-1 is specified, an object of class-name-1 may be raised by a RAISE Statement within this element.
8.
If interface-name-1 is specified, an object that implements interface-1 may be raised by a RAISE Statement within this element.
9.
a.
b.
c.
d.
e.

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left