So I am trying to create a very generic error handling procedure so that at the very least every program in our shop has it. Right now it is just wrapping a main procedure in a monitor and if it errors pass the psds to a service program. The service program logs the error so that we can set up tickets to get them fixed. Simple enough except that with the sub procedure the line number in the psds reflects the procedure and not actually where the error was, is there a way to change that or a better way?
Code:
// header specifications /Include misjd/qcpysrc,copyhspec // include procedure definitions /Include misjd/qcpysrc,copyallprc /Include misjd/qcpysrc,copypsds Monitor; Main(); On-Error; MiscP_GeneralError(pgmsds); EndMon; *Inlr = *On; Return; Dcl-Proc Main; Dcl-S result packed(1); dcl-s one packed(1) inz(1); dcl-s zero packed(1) inz(0); result = one / zero; End-Proc;
Comment