Return to the RPG Tips
Execute commands from RPG and Monitor for error messages. (2nd style)
dPsds sds d Ps_Proc_Name *Proc d Ps_Pgm_Status *Status d Ps_Routine *Routine d Ps_Parms *Parms d Ps_Excp_Msg_Id 7 Overlay(Psds:40) d Ps_Excp_Type 3 Overlay(Ps_Excp_Msg_Id) d Ps_Excp_Num 4 Overlay(Ps_Excp_Msg_Id:3) : : d Qcmdexc pr Extpgm('QCMDEXC') d Cmd Like(Qcmd) Options(*Varsize) Const d Cmdlen 15p 5 Const d CmdOpt 3 Options(*NoPass) Const d Qcmd s 3000 : : c Eval Qcmd = CrtDupP1 + %Trimr(DtaLib) c + CrtDupP2 c CallP(e) Qcmdexc(Qcmd : %Len(%Trim(Qcmd))) c If %Error And c Ps_Excp_Msg_Id = 'CPF2130' c Eval Qcmd = ClrPfmWk c CallP Qcmdexc(Qcmd : %Len(%Trim(Qcmd))) c EndIf HTH, Regards, Jon A. Erickson
[report a broken link by clicking here]