ContentsIndexPreviousNext

C$CALLEDBY Routine

This routine 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 will return the PROGRAM-ID. If the object is not in an object library, the disk name will be 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