× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



BLUF: How do you perform failure analysis of a program hours or days
after the program fell over?

I have a programming pattern that I use in order to capture a post
mortem dump in the case of a catastrophic error that I didn't foresee.
I wrap the entire cycle main program in a MONITOR block and run the
cleanup everywhere I RETURN, as well as in the ON-ERROR block; it looks
like this:

monitor;
...
// all is well
wrkReturnCode = '1';
wrkReturnMsg = 'All is well';
exsr setReturnState;
return;
...
on-error;
wrkReturnCode = '0';
wrkReturnMsg = 'Casters up!';
exsr setReturnState;
return;
endmon;

begsr setReturnState;
QsyReleaseProfileHandle(profile_current_handle: errorStruc);
if err_use <> 0;
dump(a) 'release current';
endif;
...
endsr;


Then, ON-EXIT came along! Following the hint in the manual, I moved all
the code into a single sub-procedure and called that from the mainline.
Within that sub-procedure, I put this:

dcl-proc...

ON-EXIT;
QsyReleaseProfileHandle(profile_current_handle: errorStruc);
if err_use <> 0;
dump(a) 'release current';
endif;
...
end-proc;

DUMP is disallowed by RNF0203 (in capital letters, no less!) What do
other RPGers think about this programming pattern? How do you handle
post failure diagnosis? Log4RPG? Spooled file? CEE4RAGE + *NEW
activation group?


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.