This is an Enterprise COBOL V5/6 question. No earlier compiler versions are involved.
Is it possible for a called COBOL program to dynamically determine the name of the calling COBOL program (i.e., the PROGRAM-ID value)? I have been reading the LE Vendor Interfaces manual but I have yet to figure out now to use any of the documented services or control blocks to get the name of the caller. I need this for determining from where a high-usage subroutine is being called unnecessarily in a large main program (many called modules with multiple levels of CALL, but no recursion). The subroutine unfortunately is NOT passed the name of the caller in the LINKAGE parameters (that would have been too easy . . . ). Any RTFM pointers or process to follow to get the caller's name would be appreciated. I am willing to set up an assembler stub routine to capture the data if it cannot be done directly from the COBOL called subroutine. Peter -- This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN