[comp.os.vms] Calling .COM files from FORTRAN

SLOANE@UKANVAX.BITNET (BOB) (05/21/87)

I am trying to find a way to execute a .COM or .EXE file from within
a FORTRAN program so the the file is executed from within the same
process context as the FORTRAN program.  Specifically, I would like to
be able to create a .COM file that contains a $ SET COMMAND foo, defines some
logicals, and then execute the .COM file to define the commands and logicals.
LIB$SPAWN appears to create a new process, and any commands/logicals/symbols
defined go away when the .COM file terminates.

                      Bob Sloane
                      University of Kansas
                      Computer Center
                      (913) 864-4291
                      SLOANE@UKANVAX on BITNET

DHASKIN@CLARKU.BITNET (Denis W. Haskin, Manager, Technical Services) (05/22/87)

Bob Sloane <SLOANE@UKANVAX.BITNET>:

> I am trying to find a way to execute a .COM or .EXE file from within a
> FORTRAN program so the the file is executed from within the same process
> context as the FORTRAN program.  Specifically, I would like to be able to
> create a .COM file that contains a $ SET COMMAND foo, defines some
> logicals, and then execute the .COM file to define the commands and
> logicals. LIB$SPAWN appears to create a new process, and any
> commands/logicals/symbols defined go away when the .COM file terminates.

For the logicals, how about putting them in the job table instead of
the process table?  Then they should be available to the parent process
as well.  Alternatively, they could go in the group table as well, but
that might affect other processes in an adverse fashion.

Why do you need to execute the SET COMMAND for a currently executing image?
Could you set up an alternate command table (as opposed to
SYS$SHARE:DCLTABLES.EXE) and have that be the command table for that
process?  That is specificable by /TABLES at login or at $CREPRC...
I don't remember whether LIB$SPAWN will allow an alternate table; prkobably
not.  Is the SET COMMAND to be used for later spawns?  For commands
to be executed after the image exits?


% Denis W. Haskin                             Manager, Technical Services %
% ----------------------------------------------------------------------- %
% DHASKIN@CLARKU.BITNET   Office of Information Systems     (617)793-7193 %
% Clark University               950 Main Street      Worcester MA  01610 %
%                                                                         %
% "Anyone who _moves_ before Most Holy comes back out will spend the rest %
%  of eternity sipping lava through an iron straw."        - Cerebus      %