The CHILD() function tests whether a phantom process started from the current session is still running.
The CHILD() function allows a process that started a phantom process to determine whether the phantom is still running. The userno argument is the user number of the phantom process as returned by the PHANTOM command via the @SYSTEM.RETURN.CODE variable.
The CHILD() function returns True if there is a phantom process running with the given user number that was started by the process in which the CHILD() function is executed. In all other cases, the function returns False.
The CHILD() function cannot be used to test the state of phantoms started by other sessions.
EXECUTE "PHANTOM RUN END.OF.MONTH"
UID = @SYSTEM.RETURN.CODE
IF CHILD(UID) THEN DISPLAY "End of month process is still active"
This program fragment starts a phantom to run the END.OF.MONTH program, does some further processing, and then tests whether the phantom is still active.