Call

Top  Previous  Next

This command causes GAMS to call an external program or operating system command during compilation interrupting compilation until the command has been completed.  This command is invoked using the syntax

 

$call externalcommand arg1, arg2,..

 

Quotes may be placed around the command.

Example:

$call 'copy myfile newname'

Notes:

Call is discussed extensively in the Links to Other Programs Including Spreadsheets chapter.
There is a counterpart command called Execute that is discussed in the Links to Other Programs Including Spreadsheets chapter that operates at execution time.
Compilation errors are issued if the command or the command processor cannot be loaded and executed properly.
The command string can be passed to the system and executed directly without using a command processor by prefixing the command with an '=' sign.

 $call 'gams trnsport'

 $call '=gams trnsport'

 

 In the second call, the return codes from the system are intercepted and made available to the GAMS system through the errorlevel DOS batch function but they are not in the first.