Here's a little user-defined function which might help out.  Hope it
helps.

Perry

-----------------------------------------------------------------
FUNCTION CALLSTACK
!
* RETURN ATTRIBUTE-DELMITED CALLSTACK
*
* 07/08/2004
* PERRY TAYLOR
!
      CALLSTK = DELETE(SYSTEM(9001), 1)

      FOR AMC = DCOUNT(CALLSTK, @AM) TO 1 STEP -1

         IF LEN(CALLSTK<AMC>) THEN

            FILESPEC = CALLSTK<AMC, 2>

            CALLSTK<AMC> = NUL

            FOR NC = LEN(FILESPEC) TO 1 STEP -1

               CH = FILESPEC[NC, 1]
               IF CH = '/' OR CH = '\' THEN EXIT

               CALLSTK<AMC> = CH: CALLSTK<AMC>

            NEXT NC
               
         END ELSE

            CALLSTK = DELETE(CALLSTK, AMC)

         END

      NEXT AMC

      RETURN(CALLSTK)
-----------------------------------------------------------------
 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of phil walker
Sent: Monday, September 03, 2007 6:00 AM
To: [email protected]
Subject: RE: [U2] [UV] - Getting the call stack trace within a program

SYSTEM(9001) from memory.

A multvalued array with the stack level, program and address in
multivalues if my memory serves me correctly. One attribute for each
stack entry.

Cheers,

Phil

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Symeon Breen
Sent: Monday, 3 September 2007 9:45 p.m.
To: [email protected]
Subject: RE: [U2] [UV] - Getting the call stack trace within a program

In Unidata it is system(49)  Not sure what number it is in uv but it is
a system function call.


Rgds
Symeon.



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bernard Lubin
Sent: 03 September 2007 08:47
To: [email protected]
Subject: [U2] [UV] - Getting the call stack trace within a program

I would like to write a program that will enable me to identify which
program has modified our master file.  I have a generic program that
issues
the write command, but would like to know what program/subroutine called
this generic program.  Alternatively, I am also looking at putting a
trigger
on the file to identify when the record was modified.  
 
One of the details that I want to capture is the call stack trace (Like
the
one produced by the debugger/RAID T command)
 
Is it possible for me to execute a basic statement/function that will
return
the call stack trace. I know that we can issue a PORT.STATUS PID 9999
LAYER.STACK, However, this is a very resource hungry command (and can
only
be executed by 1 user at a time) and also the PORT.STATUS command cannot
be
issued from a file trigger program.
 
For example if I have PROGRAMA that calls SUBRA which in turns calls
SUBRA2
and finally the GENERIC.WRITE, I would like to issue a command that will
return the subroutine stack : PROGRAMA ; SUBRA; SUBRA2; GENERIC.WRITE
(preferably with the line number that called the various subroutines)
 
Thanks 
 
Bernard Lubin
Development Department
Reynolds and Reynolds
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for 
the sole use of the intended recipient(s) and may contain confidential and 
privileged information.  Any unauthorized review, use, disclosure or 
distribution is prohibited. ZirMed, Inc. has strict policies regarding the 
content of e-mail communications, specifically Protected Health Information, 
any communications containing such material will be returned to the originating 
party with such advisement noted. If you are not the intended recipient, please 
contact the sender by reply e-mail and destroy all copies of the original 
message.
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to