Yes, the compiler will assume that the definitions (if there are any, which of course there are for COBOL) are the same. Remember that everything on the CALL ... USING ... should also match to the PROCEDURE DIVISION USING ..., so nothing different there.
What is different is the treatment for RETURNING, as you have outlined, depending on what is being returned, see the part starting "when the target is returned" in the following quote:
RETURNING phrase
identifier-5
The RETURNING data item, which can be any data item defined in the DATA DIVISION. The return value of the called program is implicitly stored into identifier-5.
You can specify the RETURNING phrase for calls to functions written in COBOL, C, or in other programming languages that use C linkage conventions. If you specify the RETURNING phrase on a CALL to a COBOL subprogram:
v The called subprogram must specify the RETURNING phrase on its PROCEDURE DIVISION header.
v identifier-5 and the corresponding PROCEDURE DIVISION RETURNING identifier in the target program must have the same PICTURE, USAGE, SIGN, SYNCHRONIZE, JUSTIFIED, and BLANK WHEN ZERO clauses (except that PICTURE clause currency symbols can differ, and periods and commas can be interchanged due to the DECIMAL POINT IS COMMA clause).
When the target returns, its return value is assigned to identifier-5 using the rules for the SET statement if identifier-6 is of usage INDEX, POINTER, FUNCTION-POINTER, PROCEDURE-POINTER, or OBJECT REFERENCE.
When identifier-5 is of any other usage, the rules for the MOVE statement are used.
The CALL ... RETURNING data item is an output-only parameter. On entry to the called program, the initial state of the PROCEDURE DIVISION RETURNING data item has an undefined and unpredictable value. You must initialize the PROCEDURE DIVISION RETURNING data item in the called program before you reference its value. The value that is passed back to the calling program is the final value of the PROCEDURE DIVISION RETURNING data item when the called program returns.
Note: If a COBOL program returns a doubleword binary item via a PROCEDURE DIVISION RETURNING header to a calling COBOL program with a CALL ... RETURNING statement, an issue occurs if only one of the programs is recompiled with Enterprise COBOL V6. Both the called and calling programs must be recompiled with Enterprise COBOL V6 together, so that the linkage convention for the RETURNING item is consistent.
If an EXCEPTION or OVERFLOW occurs, identifier-5 is not changed. identifier-5
must not be reference-modified.
The RETURN-CODE special register is not set by execution of CALL statements that include the RETURNING phrase.
I doubt the behaviour can be changed, because it has to match to the C/C++ conventions to be any use. No information on type is passed between CALLer/CALLee on a CALL in Enterprise COBOL, so assumptions have to be made on the data-definitions.
Note that for other languages, RETURNING on a CALL is only possible if the other language follows C/C++ linkage conventions, also note a change in processing at V5.1, and a further change in V6.1 if you have double-word values (both CALLer and CALLee need to be compiled with V6.1).
What you describe for numbers and PIC X(1) is relevant in a different context, not for RETURNING (although I don't know what was "wrong" before V5.1, so maybe applies if you have observed that with V4.2). Those limits are on BY VALUE on the CALL ... USING ... and PROCEDURE DIVISION USING ...
RETURNING is an IBM Extension to COBOL 85, as is BY VALUE.
BillWoodger