Question

I'm trying to pass information between main process and subprocess ( learning how this all works in the process) I need to get information from the subprocess, in this case the value of g_start. This is the way i seen online to handle this, if there is a better way please let me know!

Main file contains

$ define/job/nolog g_start false
$ g_test == 6
$ spawn @test.com
$ if f$trnlnm(g_start) .eqs. true
$ then

File test.com contains:

$ If g_test .nes. 5 
$ then
$ define/job g_start true
$ endif
$ logout

When running the main file g_test is not found what am I doing wrong that I'm not getting data to pass back and forth between main processes and subprocesses.

Was it helpful?

Solution

DCL symbols (g_test) aren't shared between processes. Using shared logical names, e.g. in the job table, will work.

More advanced communications, e.g. passing messages, may be done using mailboxes.

EDIT: To clarify, spawn/symbols will cause symbols to be copied to the subprocess on creation, but that creates a new set of symbols. The parent process then goes its merry way and any symbol updates in either process occur independently.

OTHER TIPS

I was able to resolve this, typo on my part i guess.

File 1:

$ define/job g_start false
$ g_test == 6
$ spawn @test.com
$ result = f$trnlnm("g_start")
$ write sys$output ''result'
$ if (''result' .eq. "true")
$ then

File 2:

$ If g_test .nes. 5 
$ then
$ define/job g_start true
$ endif
$ logout
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top