C$CALLEDBY

Returns the name of the caller of the currently running COBOL program or spaces if no caller exists or if the caller is unknown.

Usage

CALL "C$CALLEDBY" 
    USING CALLING-PROGRAM
    GIVING CALL-STATUS

Parameters

CALLING-PROGRAM PIC X(n)    Contains the name of the calling program or spaces if no caller exists or if the caller is unknown. The runtime will use as much space for the name or spaces as the COBOL program allows. If the object being called is in an object library, the program returns the PROGRAM-ID. If the object is not in an object library, the disk name is returned.
CALL-STATUS PIC S99 This parameter receives one of the following values:

1 - Routine called by another COBOL program
0 - Routine is the main program; no caller exists
-1 - Caller unknown; routine not called by a COBOL program