X"91" function 35

Performs an EXEC call (like the DOS 4B call) to the specified program file, executing it.

Note:
  • This function is not supported in JVM COBOL.
  • This function is not supported on UNIX.

Syntax:

call x"91" using result
                 function-code
                 parameter

Parameters:

result
Using call prototype (see Library Routines - Key) : cblt-x1-compx
Picture: pic x comp-x.
function-code
Using call prototype (see Library Routines - Key) : cblt-x1-compx
Picture: pic x comp-x.
parameter
Group containing:
name-len   cblt-x1-compx   *> pic x comp-x
progname   pic x(n)        *> pic x(n)

On Entry:

function
Value 35
name-len
The number of characters in the name of the program. If this is set to zero, whatever has been previously written to the command line is executed.
progname
The filename of the program to be executed.

On Exit:

result
Zero if the EXEC call was successful, non-zero otherwise. If the reason for failure is a non-zero return code from the executed program then that value is returned. For other error conditions a value of 255 is returned. However, in .NET, if the target program does not exist, no error is returned.

Comments:

To execute a command line instead of just a named program, set name-len to zero, and set the command line using the DISPLAY...UPON COMMAND-LINE syntax.