The Question is:
I am trying to spawn a cms command procedure from a COBOL programm running
under a subsystem. I'm using the LIB$SPAWN call and setting the SUBSYSTEM bit.
When LIB$SPAWN is called, the protected subsystem identifier is not passed to
the spawned process, wh
ich is contrary to the LIB$ RTL REF manual. What do I need to do to resolve the
01 SUBSYSTEM PIC S9(09) COMP VALUE 256.
CALL "LIB$SPAWN" USING BY DESCRIPTOR "show process/priv"
BY REFERENCE SUBSYSTEM
The Answer is :
Use of callable CMS would be recommended.
Subsystem identifiers are effectively not passed and not passable
to DCL procedures, as the identifier exists in the subprocess only
until the first image is run down. That image, in the case of a
DCL spawn, is LOGINOUT. (As currently implemented within OpenVMS,
the SUBSYSTEM flag is not particularly useful on a SPAWN operation.
The SUBSYSTEM flag on $creprc can be more useful, save for cases
where that mechanism is used to start DCL via LOGINOUT, obviously.)
The approach the OpenVMS Wizard uses tends to be asked on DECnet
task-to-task or other such interprocess communications with a
trusted server process, and that server then invokes the necessary
commands and DCL procedures. Related general examples include
The OpenVMS Wizard also makes extensive use of callable CMS.