Use the RETURNING phrase in the PROCEDURE DIVISION header of a program to return information to the calling program.
PROCEDURE DIVISION RETURNING dataname2
When the called program in the example above successfully returns to its caller, the value in dataname2 is stored into the identifier that you specified in the RETURNING phrase of the CALL statement:
CALL . . . RETURNING dataname2