Using NS3000/iX Network Services (36920-90008)

Chapter 2 39
Virtual Terminal
Using DSLINE and REMOTE Within Programs
Using DSLINE and REMOTE Within
Programs
Both the DSLINE and REMOTE commands can be executed within a
program using the COMMAND intrinsic. You can set up environment
attributes, log on remote sessions, and issue remote commands from
within a program. For the format of the COMMAND intrinsic, refer to the
MPE/iX Intrinsics Reference Manual.
NS 3000/iX maintains separate default environments for each process
within a job or session. A DSLINE or REMOTE command that explicitly
specifies an environment ID must be issued from the process to set up
its default environment. Subsequent DSLINE or REMOTE commands
issued from the process may then use (or change) the process default
environment. For example, suppose an application has two processes
that set up remote sessions on different nodes. These processes could
execute the following command sequences using the COMMAND intrinsic:
Process 1
DSLINE NODE1 {sets default environment for process 1}
REMOTE HELLO USER1.ACCT1 {uses default environment NODE1}
Process 2
DSLINE NODE2 {sets default environment for process 2}
REMOTE HELLO USER2.ACCT2 {uses default environment NODE2}
Because NS 3000/iX maintains separate default environments for each
of these processes, they can execute concurrently with no problems of
confusion between the default environments.
DSLINE commands for the same environment can be issued from
several different processes within a job or session. Attributes defined by
the DSLINE commands take effect for all processes within the job or
session. For example, if a DSLINE from one process specifies the COMP
option, the COMP attribute is set for all processes using the
environment.
NS 3000/iX keeps track of each process that issues a DSLINE command
for an environment. The environment will not be deleted until all the
processes have issued DSLINE;CLOSE commands. If any process
terminates without issuing the DSLINE;CLOSE, one will be implicitly
performed for the environment.
Only environments defined by DSLINE or REMOTE commands within a
process will be displayed by generic DSLINE commands. For example, if
you issue a DSLINE @;SHOW command from a process, only those
environments defined within the process will be displayed.
Several processes within a job or session can issue REMOTE commands
to the same remote session. However, this practice is not advised, since
the commands will be unpredictably interleaved depending on the order