PROCESSINFO()

Returns statistical information about the process identified by name and pid on the specified Agent. When using AGENT=, the request is forwarded to the named Agent. When using SSL=Y, an encrypted connection is established. The required certificate information is to be provided with ssldef (refer to SOCKETCALL - SSL_CONNECT function).

PROCESSINFO(connection, name, pid, stem)
connection is defined as:
HOSTNAME=ip-addr/name,PORT=port[,AGENT=ip-addr/name]
   	[,USER=userid,PWD=password][,SSL={Y|N}[,ssldef]]

The return value is zero if the function has been completed successfully or contains an error code. The content of argument pid can be determined using a previous call of function PROCESSINSTANCE() or PROCESSLIST().

0
Call successful
<>0
Error during call

After a successful completion of the function, the following information is provided in STEM variables:

STEM.ScriptName Process name
STEM.ScriptID Process PID
STEM.ScriptStatus Internal process state
STEM.LC_InCount Number of input control records
STEM.LB_InCount Number of input data blocks
STEM.LR_InCount Number of input data records
STEM.LC_OutCount Number of output control records
STEM.LB_OutCount Number of output data blocks
STEM.LR_OutCount Number of output data records
STEM.LUW_Count Number of processed LUWs
STEM.LUW_MaxOpenCount Number of parallel open LUWs
STEM.LUW_UncomittedCount Number of current open LUWs
STEM.BUBC_Inserted BatchCompare: Number of detected INSERTs
STEM.BUBC_Deleted BatchCompare: Number of detected DELETEs
STEM.BUBC_Updated BatchCompare: Number of detected UPDATEs
STEM.BUBC_Unchanged BatchCompare: Number of unchanged records
STEM.STAT_MemoryAllocated Max. allocated storage
STEM.RemoteScriptName Name of remote process
STEM.RempteScriptID PID of remote process
STEM.RemoteSysid Sysid where the remote process is executed
STEM.LastProcessTimestamp Timestamp of last processed data records

Example

connection = "HOSTNAME=192.168.0.231,PORT=4131"
name = "TEST"
rc = PROCESSINSTANCE(connection, name)
IF rc > 0 THEN DO
   pid = rc
   say 'PID of process =' pid
   rc = PROCESSINFO(connection, name, pid, "List")
   IF rc <> 0 THEN DO
     say 'Error during PROCESSINFO' rc
   END
   ELSE DO
     say "LastProcessTimestamp:" List.LastProcessTimestamp
   END
END