CALL "C$CALLEDBY" USING callingProgram GIVING returnCode |
callingProgram | PIC X(n) | Receives the name of the caller. |
1 | The currently running program has been called by another isCOBOL program. |
0 | The currently running program is the main program, no other isCOBOL program has called it. |
-1 | The currently running program has not been called by another isCOBOL program, the caller is unknown |
working-storage section. 77 calling-prg pic x(256). ... procedure division. main. call "c$calledby" using calling-prg if calling-prg = spaces display message "No program called me" else display message "I was called by program : " calling-prg end-if. |