View Full Version : RCVMSG for a pgm no longer active?
Guest.Visitor
01-01-1995, 02:00 AM
Hello all, I have a CL that calls QCMDEXC to execute a command built as a string. If that cmd has an error I get the CPF0001 from QCMDEXC, but the original CPF0001 sent by the command to QCMDEXC is still in the joblog. I'd really like the joblog to be clean, since I'm handling the error. Anyone know of a way to receive/remove that message sent to QCMDEXC (which is, of course, no longer on the call stack) when I don't have the message key (MRK) and do not want to use RMVMSG CLEAR(*ALL) or *ALLINACT? Thanks, Michael
Guest.Visitor
05-03-1999, 01:46 PM
Have you tried, RCVMSG MSGTYPE(*EXCP) <HR> On Monday, May 03, 1999, 12:01 PM, Michael Polutta wrote: Hello all, I have a CL that calls QCMDEXC to execute a command built as a string. If that cmd has an error I get the CPF0001 from QCMDEXC, but the original CPF0001 sent by the command to QCMDEXC is still in the joblog. I'd really like the joblog to be clean, since I'm handling the error. Anyone know of a way to receive/remove that message sent to QCMDEXC (which is, of course, no longer on the call stack) when I don't have the message key (MRK) and do not want to use RMVMSG CLEAR(*ALL) or *ALLINACT? Thanks, Michael
Guest.Visitor
05-03-1999, 02:03 PM
Yes, I have. The message is an 'old' message (IOW, QCMDEXC received it but did not remove it). To use RCVMSG *EXCP to get this message I would have to have the MRK (message key) to point to it explicitly. Since QCMDEXC was not so kind as to provide this, I am looking for an alternative. We really want the joblog clean, but are absolutely unwilling to use the CLEAR(*ALL) sledgehammer.
Guest.Visitor
05-03-1999, 04:15 PM
Could you give some more details about the situation where you want to use QCMDEXC in a CLP; It's an interesting concept... ...... <pre> <H4>Bob Hamilton TEXAS BUSINESS SYSTEMS 736 Pinehurst Richardson, Texas 75080 <h4> </pre></h4></h4>
Guest.Visitor
05-03-1999, 05:16 PM
On Monday, May 03, 1999, 04:15 PM, Bob Hamilton wrote: Could you give some more details about the situation where you want to use QCMDEXC in a CLP; It's an interesting concept... <pre> <H4> Bob Hamilton TEXAS BUSINESS SYSTEMS 736 Pinehurst Richardson, Texas 75080 <h4> </pre> I'm building a command to execute based on some parms I retrieve. If the command fails I trap that message and rebuild the command, changing it to avoid the error. The problem is that QCMDEXC receives the *ESCAPE message sent to it and sends another. It doesn't remove the message sent to it. I'm sure this is by design - leave the evidence of the actual problem in the joblog. However, I'm trying to leave the joblog pristine clean. I need to get to a message that has already been received (marked as 'old') by a program that is no longer active in the call stack. If I had the message key I could receive/remove it. That key is not available to me (as far as I can tell). Ideas?</h4></h4>
Guest.Visitor
05-03-1999, 05:33 PM
<font color="#0000CC">On Monday, May 03, 1999, 12:01 PM, Michael Polutta wrote: I have a CL that calls QCMDEXC to execute a command built as a string. If that cmd has an error I get the CPF0001 from QCMDEXC, but the original CPF0001 sent by the command to QCMDEXC is still in the joblog. I'd really like the joblog to be clean, since I'm handling the error. Anyone know of a way to receive/remove that message sent to QCMDEXC (which is, of course, no longer on the call stack) when I don't have the message key (MRK) and do not want to use RMVMSG CLEAR(*ALL) or *ALLINACT? </font> Michael, One approach may be to use QCAPCMD instead of QCMDEXC. From memory it returns the actual exception rather than the silly 'command failed' exception that QCMDEXC returns. Should be much easier to tidy up after... :-) Derek
Guest.Visitor
05-04-1999, 11:02 AM
On Monday, May 03, 1999, 05:33 PM, Derek Butland wrote: Michael, One approach may be to use QCAPCMD instead of QCMDEXC. From memory it returns the actual exception rather than the silly 'command failed' exception that QCMDEXC returns. Should be much easier to tidy up after... :-) Derek Derek, YOU DA MAN! That was the ticket. The API (one I had never used, actually I didn't know it existed!) returns the *DIAG messages back to me, but stashes the *ESCAPE in the API Error Parameter. Perfect! Thanks for the tip. If I ever meet you, I'll buy you the beverage of your choice. Thanks again, Michael
Guest.Visitor
02-10-2000, 07:00 AM
Michael, How do you capture the *DIAG messages? I can't seem to get it to work. Any examples would be appreciated. Thanks Dale Monti
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.