KB Article #51048

How to call shell script in a MBC or DML

Problem

How to call shell script in a MBC or DML


Resolution

Message Builder :
The CALL statement executes command using the command interpreter (sh for UNIX
systems, cmd for Windows systems, and QCMD for AS/400 systems). The command
parameter is an expression that is converted to a string.



Ex :
DECLARE VARIABLE $exitCode INTEGER;
CALL "c4edi another.s4" EXIT $exitCode;
IF $exitCode = 0 {
/* no compilation errors */
CALL "r4edi another.s4";
}



DML :
Use the DML function "runProgram" that will run a command from a Map-Broker or a Check-Constraint.
Note that by default, runProgram is a "bloking" call, but it is possible to make it "non-bloking" by using "nohup" instruction in the command