· Jun 12, 2017

Possible to view the contents of a process private global?

I know the process ID< and I know the global name: ^||testing(index).  From the terminal (and therefore, and different process ID), how do I view the contents of ^||testing() ?  Not the list of process private globals; the contents of this single PPG.



Discussion (5)1
Log in or sign up to continue

Hello Laura,

If you are doing this interactively, then the ^JOBEXAM utility might come in handy:

1.  Do ^JOBEXAM (in the %SYS namespace of a terminal session)

2.  Type E and then enter either the Job # or P followed by the pid of the target process (e.g. P7176)

3.  Type P to view process-private globals

4.  Enter the name of the process-private global you want to examine.  Examples:

Process Private Global (?): testing
Process Private Global (?): testing(1)

Does this help you accomplish what you were trying to do?

For a more direct approach, see the class query %SYS.ProcessQuery:PPG - it's not [SqlProc] so you need to call it the old-fashioned way.

For example:

Terminal 1:

USER>w $j
USER>s ^||demo(2)=5,^||demo=2
USER>zw ^||demo

Terminal 2:

%SYS>set rs = ##class(%ResultSet).%New("%SYS.ProcessQuery:PPG")
%SYS>set sc = rs.Execute("demo",10740)
%SYS>while rs.%Next() { do rs.%Print() }
demo 2
demo(2) 5