The Procedure Division is identified by and must begin with a header in one of the following formats:
. 
 
               
             
 
               

 
 
                
 
               
             Mnemonic-name is necessary only if the runtime element is being invoked by another runtime element and that runtime element
                     is using a calling convention other than that used as default by your COBOL system. Typically, the default COBOL calling convention
                     is consistent with that used by a significant implementation of a non-COBOL language for the run-time environment.
 Mnemonic-name is necessary only if the runtime element is being invoked by another runtime element and that runtime element
                     is using a calling convention other than that used as default by your COBOL system. Typically, the default COBOL calling convention
                     is consistent with that used by a significant implementation of a non-COBOL language for the run-time environment. 
                     		
                     Mnemonic-name must be defined in the Special-Names paragraph. See the topic The Special-Names Paragraph in the chapter Environment Division for details of how to do this and your COBOL system documentation on interfacing for details of which calling conventions are supported in your run time environment.
 CHAINING and USING are equivalent.
 CHAINING and USING are equivalent. 
                     	 
                  
 If data-name-1 or data-name-2 is defined with the USAGE OBJECT REFERENCE clause, the ACTIVE-CLASS phrase must not be specified.
 If data-name-1 or data-name-2 is defined with the USAGE OBJECT REFERENCE clause, the ACTIVE-CLASS phrase must not be specified.
                     
                     	 
                  
 Data-name-3 must be defined as a level 01 or level 77 entry in the Linkage Section. The data description entry for data-name-3
                     must not contain a REDEFINES clause. A data item elsewhere in the Linkage Section may specify REDEFINES data-name-3.
 Data-name-3 must be defined as a level 01 or level 77 entry in the Linkage Section. The data description entry for data-name-3
                     must not contain a REDEFINES clause. A data item elsewhere in the Linkage Section may specify REDEFINES data-name-3. 
                     	 
                  
 Data-name-3 must not be the same as data-name-1 or data-name-2.
 Data-name-3 must not be the same as data-name-1 or data-name-2. 
                     	 
                   
                        		   , File Section or Working-Storage Section
 , File Section or Working-Storage Section 
                        		
                     
. A particular user-defined word must not appear more than once as data-name-1.


 It may appear more than once.
 It may appear more than once. 
                        		
                     
The data description entry for data-name-1 must not contain a REDEFINES clause.


 It may contain a REDEFINES clause.
 It may contain a REDEFINES clause. 
                        		
                     
Data-name-1 may, however, be the object of a REDEFINES clause elsewhere in the Linkage Section.

 Data-name-2 must be defined as a level 01 or a level 77 entry in the Linkage Section
 Data-name-2 must be defined as a level 01 or a level 77 entry in the Linkage Section 
                     		
                      
                        		   , File Section or Working-Storage Section , unless the source unit is a method definition or method prototype definition
 , File Section or Working-Storage Section , unless the source unit is a method definition or method prototype definition 
                           		   
                        		
                     
. Data-name-2 must be defined as a data item of class numeric, object or pointer.
 For JVM and .NET COBOL, data-name-2 can be any class and must be no greater than 8 bytes. For native COBOL, data-name-2 can
                        be of any class except comp-1 and comp-2. The length must be no greater than 4 bytes for 32-bit compilation, and no greater
                        than 8 bytes for 64-bit compilation.
 For JVM and .NET COBOL, data-name-2 can be any class and must be no greater than 8 bytes. For native COBOL, data-name-2 can
                        be of any class except comp-1 and comp-2. The length must be no greater than 4 bytes for 32-bit compilation, and no greater
                        than 8 bytes for 64-bit compilation. 
                        		
                     



 
 
               


 The RETURNING phrase must be specified in a function definition and in a function prototype definition.
 The RETURNING phrase must be specified in a function definition and in a function prototype definition. 
                     	 
                  


 The RETURNING phrase may be specified in a method definition, a program definition or a program prototype.
 The RETURNING phrase may be specified in a method definition, a program definition or a program prototype. 
                     	 
                   
 
                Format 2 can only be used in a program in which the EXTERNAL clause is specified in the Program-ID paragraph, that is a call
                     prototype.
 Format 2 can only be used in a program in which the EXTERNAL clause is specified in the Program-ID paragraph, that is a call
                     prototype. 
                     	 
                   Data-name-1 and data-name-2 must be defined as 01 level records in the Linkage Section.
 Data-name-1 and data-name-2 must be defined as 01 level records in the Linkage Section. 
                     	 
                   Typedef-name-1, typedef-name-2, and typedef-name-3 must be previously defined in the same source file as a programmer-defined
                     usage by means of a TYPEDEF clause.
 Typedef-name-1, typedef-name-2, and typedef-name-3 must be previously defined in the same source file as a programmer-defined
                     usage by means of a TYPEDEF clause. 
                     	 
                  
 
 
               

 Up to sixty-two data-names are permitted in the USING phrase.
 Up to sixty-two data-names are permitted in the USING phrase. 
                        		
                     


 
 
                Mnemonic-name identifies the calling convention that this program assumes has been adopted by the calling program that invokes
                     it. This calling convention is also used for subsequent entry points unless those entry points specify a calling convention
                     explicitly. If the calling convention actually used is different to that implied by mnemonic-name, then the COBOL system may
                     become corrupt.
 Mnemonic-name identifies the calling convention that this program assumes has been adopted by the calling program that invokes
                     it. This calling convention is also used for subsequent entry points unless those entry points specify a calling convention
                     explicitly. If the calling convention actually used is different to that implied by mnemonic-name, then the COBOL system may
                     become corrupt. 
                     	 
                   If data-name-1 is defined as a level 01 or a level 77 entry in the File Section or Working-Storage Section then the activated
                     runtime element operates as if a data item had been declared in the Linkage Section with the same data declaration as data-name-1
                     and the contents of that data item were moved to data-name-1 prior to executing the first statement in the activated runtime
                     element. In an initial program, these values are overwritten by the initialization of the program's working storage data and
                     are therefore not available to the called program.
 If data-name-1 is defined as a level 01 or a level 77 entry in the File Section or Working-Storage Section then the activated
                     runtime element operates as if a data item had been declared in the Linkage Section with the same data declaration as data-name-1
                     and the contents of that data item were moved to data-name-1 prior to executing the first statement in the activated runtime
                     element. In an initial program, these values are overwritten by the initialization of the program's working storage data and
                     are therefore not available to the called program. 
                     	 
                  

 If the activating runtime element is COBOL the following rules apply. If the activating runtime element is not COBOL, see
                     your COBOL system documentation on interfacing for details of when you need to use the BY REFERENCE or BY VALUE clauses.
 If the activating runtime element is COBOL the following rules apply. If the activating runtime element is not COBOL, see
                     your COBOL system documentation on interfacing for details of when you need to use the BY REFERENCE or BY VALUE clauses. 
                     	 
                  

 At all times in the activated element, references to data-name-1
 At all times in the activated element, references to data-name-1 
                     		
                      
                        		  
 , data-name-2 and data-name-3
 , data-name-2 and data-name-3 
                           		   
                        		
                     
are resolved in accordance with their description in the Linkage Section. If this description defines a greater number of character positions than the corresponding data item in the activating element, unpredictable results can occur. Failure to comply with this rule or exceeding the maximum allowed size of the system area for a particular run time environment may result in the system becoming catastrophically corrupt.
 When a program is called and a BY REFERENCE operand in the USING phrase corresponds to a parameter in the calling program,
                     a referential connection is established and endures until control is returned to the calling program. If the program is called
                     a second time, without any intervening cancel of the program, and that same BY REFERENCE operand does not correspond to a
                     parameter in the calling program, then you must not reference that operand unless the STICKY-LINKAGE Compiler directive is
                     specified.
 When a program is called and a BY REFERENCE operand in the USING phrase corresponds to a parameter in the calling program,
                     a referential connection is established and endures until control is returned to the calling program. If the program is called
                     a second time, without any intervening cancel of the program, and that same BY REFERENCE operand does not correspond to a
                     parameter in the calling program, then you must not reference that operand unless the STICKY-LINKAGE Compiler directive is
                     specified. 
                     	 
                  

 data-name 4 must be defined in the Linkage Section.
 data-name 4 must be defined in the Linkage Section. 
                     	 
                   
                        		   , function
 , function 
                        		
                     
 
                        		  
 or method for any arguments passed to it
 or method for any arguments passed to it 
                        		
                     
. The arguments passed to it are identified in the activating source element by one of the following:
 The arguments in a function-identifier
 The arguments in a function-identifier 
                           		  
                        
 The USING phrase of an INVOKE statement
 The USING phrase of an INVOKE statement 
                           		  
                        
 The arguments specified in an inline invocation of a method
 The arguments specified in an inline invocation of a method 
                           		  
                        
 The arguments defined by the rules of an object-property for invocation of an implicit SET property method.
 The arguments defined by the rules of an object-property for invocation of an implicit SET property method. 
                           		  
                        The correspondence between the two lists of names is established on a positional basis

 If the activated runtime element is a program for which there is no program-specifier in the Repository paragraph of the activating
                           runtime element, the allocated record is handled as follows.
 If the activated runtime element is a program for which there is no program-specifier in the Repository paragraph of the activating
                           runtime element, the allocated record is handled as follows.
                        
The allocated record is of the same length as the argument, where the maximum length is used if the argument is described as a variable-occurrence data item. That argument is moved to this allocated record without conversion. This record is then treated by the activated runtime element as if it were the argument and as if it were passed by reference.

 If the activated runtime element is one of the following:
 If the activated runtime element is one of the following: 
                        		
                     

 
 
                     
 A program for which there is a program-specifier in the Repository paragraph of the activating runtime element
 A program for which there is a program-specifier in the Repository paragraph of the activating runtime element 
                           		  
                        
 A method
 A method 
                           		  
                        
 A function
 A function 
                           		  
                        
 then this allocated record is one of:
 then this allocated record is one of: 
                        		
                     

 
 
                     
 A data item of the same category, usage, and length as the argument, if the formal parameter is described with the ANY LENGTH
                           clause
 A data item of the same category, usage, and length as the argument, if the formal parameter is described with the ANY LENGTH
                           clause 
                           		  
                        
 A data item with the same description and the same number of bytes as the formal parameter, where the maximum length is used
                           if the formal parameter is described as a variable-occurrence data item.
 A data item with the same description and the same number of bytes as the formal parameter, where the maximum length is used
                           if the formal parameter is described as a variable-occurrence data item. 
                           		  
                        
 The argument is used as the sending operand and the allocated record as the receiving operand in one of the following:
 The argument is used as the sending operand and the allocated record as the receiving operand in one of the following: 
                        		
                     

 
 
                     
 If the formal parameter is numeric, a COMPUTE statement without the ROUNDED phrase
 If the formal parameter is numeric, a COMPUTE statement without the ROUNDED phrase 
                           		  
                        
 If the formal parameter is of class index, object, or pointer, a SET statement
 If the formal parameter is of class index, object, or pointer, a SET statement 
                           		  
                        
 A MOVE statement.
 A MOVE statement. 
                           		  
                        
 The allocated record is then treated as if it were the argument and it were passed by reference.
 The allocated record is then treated as if it were the argument and it were passed by reference. 
                        		
                     

 If the argument is passed by value, the activated runtime element operates as if the record in the Linkage Section were allocated
                     by the activating runtime element during the process of initiating the activation and as if this record does not occupy the
                     same storage area as the argument in the activating runtime element. This allocated record is exactly the same number of alphanumeric
                     character positions in length as the argument. That argument is moved to this allocated record without conversion. This record
                     is then treated by the activated runtime element as if it were the argument and as if it were passed by reference.
 If the argument is passed by value, the activated runtime element operates as if the record in the Linkage Section were allocated
                     by the activating runtime element during the process of initiating the activation and as if this record does not occupy the
                     same storage area as the argument in the activating runtime element. This allocated record is exactly the same number of alphanumeric
                     character positions in length as the argument. That argument is moved to this allocated record without conversion. This record
                     is then treated by the activated runtime element as if it were the argument and as if it were passed by reference. 
                     	 
                  Note that, in COBOL, the storage for the returning item is allocated in the activating source unit. The activated element contains only a formal description in its linkage section.
This form of optional parameter is distinct from the optional parameter that can be used in .NET COBOL, and which applies to VALUE parameters. Such parameters are specified by use of the '= default-expression' syntax; see General Rule 18.
 
 
                If a call prototype (program with the EXTERNAL clause in the Program-ID paragraph) contains a format 2 PROCEDURE DIVISION
                     header and another program in the same source file includes a CALL literal statement referencing the program-name of this
                     call prototype, then the following rules apply:
 If a call prototype (program with the EXTERNAL clause in the Program-ID paragraph) contains a format 2 PROCEDURE DIVISION
                     header and another program in the same source file includes a CALL literal statement referencing the program-name of this
                     call prototype, then the following rules apply: 
                     		
                     
