Title: | VAX and Alpha VMS |
Notice: | This is a new VMSnotes, please read note 2.1 |
Moderator: | VAXAXP::BERNARDO |
Created: | Wed Jan 22 1997 |
Last Modified: | Fri Jun 06 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 703 |
Total number of notes: | 3722 |
Assume the following Basic program (the language is not important): OPTION TYPE = EXPLICIT ! EXTERNAL LONG FUNCTION lib$do_command DECLARE LONG stat ! ! Call LIB$DO_COMMAND to execute a simple "SHOW TIME" DCL command. ! Any command acceptable to DCL can be used. ! stat = lib$do_command ("SHOW TIME" BY DESC) CALL lib$stop (stat BY VALUE) IF (stat AND 1%) = 0% ! ! The program should not reach this part of the program. All the code ! following the call to LIB$DO_COMMAND has been placed in this program ! to show that control does NOT return to the program after a call to ! LIB$DO_COMMAND. The program is "shut down" after calling ! LIB$DO_COMMAND and the DCL command specified in the call is applied. ! Use LIB$SPAWN if you want control to return to the program. ! PRINT "This should not be printed if LIB$DO_COMMAND worked properly." END - when I use RUN SPAWN I get the expected result ie. the system time - when I use a SPAWN RUN SPAWN I also get the expected result - when I use RUN /PROC=TEST SPAWN I get no output and no error. This behavior is caused by the /PROCESS_NAME use. Can somebody explain why ? I run OVMS AXP-V6.2-1H3 Thanks in advance. Jean-Pierre
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
245.1 | LIB$_NOCLI ? | STAR::GOLDENBERG | Ruth Goldenberg | Tue Feb 25 1997 10:52 | 19 |
.0> - when I use RUN /PROC=TEST SPAWN I get no output and no error. I believe that command is creating a detached process that runs the single image SPAWN. Because that process doesn't run LOGINOUT first, DCL isn't mapped to it. Therefore there's nothing to respond to the DCL request made by the LIB$DO_COMMAND routine. If you want it to work, you should create a file that says RUN SPAWN and change your command to something like RUN/PROC=TEST/INPUT=<filename> SYS$SYSTEM:LOGINOUT (This is from memory - someone correct me if it's wrong, please.) In contrast, the command SPAWN creates a spawned subprocess, one in which LOGINOUT is run automatically in order to map DCL. I'd guess that if you looked at the accounting file, you'd see that the detached process terminated with an error. ruth | |||||
245.2 | AUSS::GARSON | DECcharity Program Office | Wed Feb 26 1997 20:58 | 15 | |
re .0 Use of nearly all qualifiers on the RUN command results in the creation of a separate process. See the HELP on RUN. This process will not by default have a CLI. If you want to see the error message then add /OUTPUT=xxxx to the RUN command where xxxx is the name of the terminal from which you issue the command. re .1 nit: The process created by the command is a subprocess not a detached process. |