Skip to main content
New Participant
Apr 17, 2023 7:10 AM UTC
Question

Phantom of Phantom output

Where could I find / how could I capture the output of a phantom started by a phantom?

We have the code: EXECUTE 'PHANTOM ':TASKNAME CAPTURING EXECMSGE executed by a phantom program.
Display statements in the first phantom are output as normal to its &PH& file.
'EXECMSGE' contains "Phantom process started -nnnnn"
The secondary process does its job, but any display statements are not written to any &PH& file

Running the secondary process from TCL shows the display outputs at the terminal
Running the secondary process as a first phantom send displays  to &PH&.

Running Universe 11.1.4 on Linux

.. I'm not in a position to be able to change how it runs (but still need to support it)

Thank you in advance for any help :)

    2 replies

    Neil Morris
    Rocketeer
    Apr 17, 2023 10:57 AM UTC

    Where could I find / how could I capture the output of a phantom started by a phantom?

    We have the code: EXECUTE 'PHANTOM ':TASKNAME CAPTURING EXECMSGE executed by a phantom program.
    Display statements in the first phantom are output as normal to its &PH& file.
    'EXECMSGE' contains "Phantom process started -nnnnn"
    The secondary process does its job, but any display statements are not written to any &PH& file

    Running the secondary process from TCL shows the display outputs at the terminal
    Running the secondary process as a first phantom send displays  to &PH&.

    Running Universe 11.1.4 on Linux

    .. I'm not in a position to be able to change how it runs (but still need to support it)

    Thank you in advance for any help :)

    The output should be written to an entry in the &PH& directory in the account where the second phantom was lost.  I just ran the following simple test to illustrate. Not sure if there was an issue at 11.1.4 or something unique about your phantom job. Are you able run the following test to see if you get the same results?

    >CT BP PHANTOM1 PHANTOM2

         PHANTOM1
    0001 CRT "IN PHANTOM1"
    0002 EXECUTE "PHANTOM RUN BP PHANTOM2" CAPTURING OUTPUT
    0003 CRT OUTPUT
    0004 END

         PHANTOM2
    0001 CRT "IN PHANTOM2"
    0002 END
    >CLEAR.FILE &PH&
    File "&PH&" has been cleared.
    >PHANTOM RUN BP PHANTOM1
    Phantom process started with process ID 23286.
    >ED &PH& *
    SELECTing all records in the file.

    SELECTed record name = "RUN_32588_20196".
    2 lines long.

    ----: P
    0001: IN PHANTOM1
    0002: Phantom process started with process ID 23288.~
    Bottom at line 2.
    ----: N

    SELECTed record name = "RUN_32589_20196".
    1 lines long.

    ----: P
    0001: IN PHANTOM2
    Bottom at line 1.
    ----: N

    File name        = &PH&
    Record name =

    New Participant
    Apr 17, 2023 6:56 PM UTC

    Where could I find / how could I capture the output of a phantom started by a phantom?

    We have the code: EXECUTE 'PHANTOM ':TASKNAME CAPTURING EXECMSGE executed by a phantom program.
    Display statements in the first phantom are output as normal to its &PH& file.
    'EXECMSGE' contains "Phantom process started -nnnnn"
    The secondary process does its job, but any display statements are not written to any &PH& file

    Running the secondary process from TCL shows the display outputs at the terminal
    Running the secondary process as a first phantom send displays  to &PH&.

    Running Universe 11.1.4 on Linux

    .. I'm not in a position to be able to change how it runs (but still need to support it)

    Thank you in advance for any help :)

    Thanks Neil.

    I tried your sample which as you expected works.

    I added the LOGTO another account which is in the original first phantom - still works
    Changed "CRT" to "DISPLAY" in case there were some difference - still works
    Changed you sample to use copies of original verbs instead of RUN - still works
    Changed your phantom1 to run the original second phantom - still works!!

    But the original is still not working - something is different.

    ~ some time later ~

    Looked again through the original code.. the LOGTO in the first phantom is not used, but another LOGTO in the second phantom is ~ so first off I'm looking for phantom output i wrong account.
    But then, now I also see, the final program is then executed from the second phantom, capturing to dummy ... not used/displayed.
    Add DISPLAY DUMMY in the second phantom now populates to the second phantoms output in the first account 

    So the issue was my not following the code trail closely enough - now that i can see the output, i can get back to trouble shooting the original (intermitant) problem i started looking at..

    Thanks Neil for bringing me back to the basics :)