× 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.



Hi Mike,

I've had pretty good success with the below and I use a lot of monitors that use the same logic as the pssr code below.

Mainline code has it's own pssr, local procedures (that may error out) will have their own pssr.

They will populate a global error message then exit proc or program.

When program is exited, if global error message is populated,
1. Send the user a simple message "Error 1, contact IT."
2. Send an email or break message to programmer. "Error in xxx pgm, check the log file"
3. Write the error message to the log file. "in depth message & msgid here, maybe some variable values too"

Mainline has an exit, return, and pssr subroutine, always.

It's not 'exactly' like below, but you'll get the idea.
This is 'somewhat' patterned after pgms I saw form easy400 site.

John B.


The pssr in the mainline and the pssr in the local proc are just a little bit different.

-- Mainline --

d gPssrSw s n inz(*off)
d gErrMsg s 256


/free

//*********************************************************************
begsr @exit;
// Subr =
//*********************************************************************


// If any nast msgs, log them b4 exit
if gErrMsg <> *blanks;
msg_User(gAlertUser:gErrMsg);
msg_Break([to programmer]);
log_Add(gErrMsg);
endif;

exsr @return;

endsr;

//*********************************************************************
begsr @return;
// Subr =
//*********************************************************************
*inlr = *on;
return;
endsr;

//*********************************************************************
begsr *pssr;
// Subr =
//*********************************************************************

if gPssrSw = *on; // this prevents getting caught in a loop
exsr @return;
endif;
gPssrSw = *on;

gErrMsg =
msg_BldErr(
%trimr(psds.Pgm)
:'Uncaught main-*pssr exception, ' +
psds.Msg + ':' + %trimr(psds.ExcDta)
:''
:''
:psds.LineNbr
);

exsr @exit;

endsr;




-- local procedures --

//********************************
begsr @exit;
//********************************

if gErrMsg <> *blanks;
msg_User(gAlertUser:gErrMsg);
msg_Break([to programmer]);
log_Add(gErrMsg);
endif;

exsr @return;

endsr;

//********************************
begsr @return;
//********************************
return;
endsr;

//********************************
begsr *pssr;
//********************************

if gPssrSw = *on;
exsr @return;
endif;
gPssrSw = *on;

gErrMsg =
msg_BldErr(
%trimr(psds.Pgm)
:'Uncaught *pssr exception, ' +
psds.Msg + ':' + %trimr(psds.ExcDta)
:utlty_ProcName()
:''
:psds.LineNbr
);
exsr @exit;

endsr;


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.