1

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.

user1943219
  • 396
  • 2
  • 5
  • 19
  • 2
    You probably meant to thave quotation marks around the logical name: `f$trnlnm( "g_start" )`. – HABO Feb 20 '13 at 18:29

2 Answers2

1

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.

HABO
  • 15,314
  • 5
  • 39
  • 57
  • So the $ define/job g_start true does not set the shared logical name? Completely new to VMS/DCL sorry – user1943219 Feb 20 '13 at 16:33
  • @user1943219 - Yes, `define/job` sets the value of the shared logical. Any process in the job, aka process tree, can create/read/update/delete (CRUD) logicals in the job table. Since the table is shared, all of the processes will see any changes. – HABO Feb 20 '13 at 18:27
0

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
user1943219
  • 396
  • 2
  • 5
  • 19