HP3000-L Archives

January 2006, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Olav Kappert <[log in to unmask]>
Reply To:
Olav Kappert <[log in to unmask]>
Date:
Sun, 8 Jan 2006 19:40:57 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (117 lines)
Tracy:

One last idea, use the MPE intrinsic "procinfo" using you current pin 
number and in return it will provide you with the pin of the calling 
process.  Use this new pin to get the name of the program file name.

I am not sure that it will get you the name of the subprogram or only 
the "CI" pin.  Give it a try and let me know how it works out.  I have 
not tried it myself recently, and I do not remember if it work a decade ago.

I do know that what you want can be done in PRIV mode because I did so 
more than 20 years ago, but without PRIV mode .....

Olav.



Tracy Pierce wrote:

>a calls b calls c calls d
>
>  
>
>>The first thing I would do is to have every program / subroutine / 
>>function call / intrinsic set with an internal name (may be 
>>the same as 
>>external).
>>
>>01  PROGRAM-ID PIC X(16) VALUE "PROGNAME".
>>    
>>
>
>this would be lovely and in fact is the intent, but we need to fill
>"PROGNAME" from an intrinsic call - going through all the source is to
>be avoided.  we're willing to change a couple of globally-used
>copybooks, to include
>01  MY-PROGRAM-ID PIC X(16).
>call intrinsic 'GETMYNAME' using MY-PIN or whatever, MY-PROGRAM-ID
>call 'd' using MY-PROGRAM-ID, otherstuff.
>
>so that d can see who rang.
>
>If Cobol offered MOVE PROGRAM-ID ..., wouldn't need to locate the
>mystery intrinsic.
>
>
>
>
>  
>
>>-----Original Message-----
>>From: Olav Kappert [mailto:[log in to unmask]] 
>>Sent: Friday, January 06, 2006 5:59 PM
>>To: Tracy Pierce
>>Cc: [log in to unmask]
>>Subject: Re: getprocname?
>>
>>Tracy:
>>
>>The first thing I would do is to have every program / subroutine / 
>>function call / intrinsic set with an internal name (may be 
>>the same as 
>>external).
>>
>>01  PROGRAM-ID PIC X(16) VALUE "PROGNAME".
>>
>>Then when calling a subroutine, pass the variable PROGRAM-ID 
>>as one of 
>>the parameters or part of the linkage section.
>>
>>If you want to get fancy, create an addition variable
>>01  PROGRAM-HISTORY OCCURS 10 TIMES.
>>      02  PROGRAM-HISTORY-TBL PIC X(16).
>>
>>Then when calling an other process, pass only the PROGRAM-HISTORY 
>>variable.  The program can determine who made the call simply by 
>>scanning the passed variable
>>
>>The first program would move the PROGRAM-ID to PROGRAM-HISTORY.
>>
>>Each subsequent program, subprogram and etc would add its 
>>PROGRAM-ID to 
>>the first non blank entry from the table PROGRAM-HISTORY-TBL.
>>
>>Hope this helps.
>>Olav.
>>
>>Tracy Pierce wrote:
>>
>>    
>>
>>>main pgm a calls xl-rez subpgm b calls c calls d.
>>>
>>>d needs to know who called.  I understand I can't get the 
>>>      
>>>
>>caller name,
>>    
>>
>>>so need to get my own name and pass that down.  how?
>>>
>>>posted on behalf of [log in to unmask]
>>>
>>>* To join/leave the list, search archives, change list settings, *
>>>* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
>>>
>>> 
>>>
>>>      
>>>
>
>  
>

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2