Return to the RPG Tips
Execute commands from RPG and Monitor for error messages. (1st style)
I would recommend the following instead. This gives you a MONMSG for your commands right in your RPG programs. H Bnddir('QC2LE') H ActGrp(*caller) H DftActGrp(*NO) * Execute Command (system) Subprocedure Variables D System PR 10I 0 ExtProc('system') D CmdText * Value Options(*String) D ErrorCPF S 7A Import('_EXCP_MSGID') D ErrorFlag S 10I 0 Inz(0) C Eval ErrorCPF=Blanks C C Eval ErrorFlag=system(cmd) C If ErrorFlag<>0 C Select C When ErrorCPF='CPF1111' C* ... C When ErrorCPF='CPF2222' C* ... C Other C* ... C EndSL C EndIf Rob Berendt
[report a broken link by clicking here]