Monitor Bug?

Monitor Bug?

Post by Sam L » Sat, 28 Jun 2003 08:48:52



I have this code which attempts to trap errors that occur in a
called CLP program.  The Monitor fails to catch the error but
%Status catches it. Why doesn't monitor catch the error?

Compiled to V5R1 on a V5R2 OS.  I get the same results when I
compile to V5R2.

What am I missing?

h dftactgrp(*no) actgrp(*caller) indent('| ')
d x               s              1    inz(X'FF')
d ACLP            pr                  extpgm('ACLP')
d x                              1
 /FREE
  monitor;
  callp(e) ACLP(x);
  on-error;
  dsply 'Monitor';
  endmon;

  callp(e) ACLP(x);
  if %status = 00202;
  dsply 'Status';
  endif;
  *inlr = *on;
 /END-FREE

ACLP, designed to give decimal data errors:
  PGM PARM(&INC)
  DCL VAR(&INC)        TYPE(*DEC)  LEN(1 0)
  DCL VAR(&SUM)        TYPE(*DEC)  LEN(1)
  CHGVAR VAR(&SUM) VALUE(&SUM + &INC)
  ENDPGM

 
 
 

Monitor Bug?

Post by Barbara Morri » Sat, 28 Jun 2003 09:29:59



> I have this code which attempts to trap errors that occur in a
> called CLP program.  The Monitor fails to catch the error but
> %Status catches it. Why doesn't monitor catch the error?
> ...
> What am I missing?
> ...
>  /FREE
>   monitor;
>   callp(e) ACLP(x);
>   on-error;
>   dsply 'Monitor';
>   endmon;

>   callp(e) ACLP(x);
>   if %status = 00202;
>   dsply 'Status';
>   endif;
>   *inlr = *on;
>  /END-FREE

It's not %status that's catching it in the second section, it's the
(e).  The (e) is catching it in the first section too.  Try this:

   monitor;
     callp ACLP(x);      // no (e)
   on-error;
     dsply 'Monitor';
   endmon;

 
 
 

Monitor Bug?

Post by Sam L » Sat, 28 Jun 2003 10:02:38




> > I have this code which attempts to trap errors that occur in
a
> > called CLP program.  The Monitor fails to catch the error but
> > %Status catches it. Why doesn't monitor catch the error?
> > ...
> > What am I missing?
> > ...
> >  /FREE
> >   monitor;
> >   callp(e) ACLP(x);
> >   on-error;
> >   dsply 'Monitor';
> >   endmon;

> >   callp(e) ACLP(x);
> >   if %status = 00202;
> >   dsply 'Status';
> >   endif;
> >   *inlr = *on;
> >  /END-FREE

> It's not %status that's catching it in the second section, it's
the
> (e).  The (e) is catching it in the first section too.  Try
this:

>    monitor;
>      callp ACLP(x);      // no (e)
>    on-error;
>      dsply 'Monitor';
>    endmon;

In my original code I didn't have the (e) and it never came back
to my RPG.  RPG handler jumped in with RPG0202 and bounced me
back to my calling CLP. Granted I was running under debug so I
could create a failure in the called CLP.  So I changed to the
(e) and found it still didn't work with monitor.  I finally gave
up and went to (e) and %status.

I'll give it a whirl with my (above) test program without the (e)
tomorrow.  Maybe I just had a brain spasm...

Sam

 
 
 

Monitor Bug?

Post by Jean-Philippe BALLA » Sun, 29 Jun 2003 04:52:58


Hello :!!!

I'm french!!

And if you intercept msg in clp is better: monmsg cpf0000 or monmsg cpf9999

friendly !!!

 
 
 

Monitor Bug?

Post by Sam L » Tue, 01 Jul 2003 09:43:53


I've done some more experimentation, but I'm still confused.  If
my called CLP has a decimal data error, the monitor fails to
catch it and I get booted out of the calling RPG because the
standard RPG error handler gets invoked.  Maybe it is something
to do with the MCH1202 that comes from the decimal data error.

If I have the CLP send an escape message, the monitor catches it
when (e)is not specified.

%Status catches both the decimal data error and the escape
message.

Here's my test RPG, which I'm calling from QCMD.

     h dftactgrp(*no) actgrp(*caller) indent('| ')
     d x               s              1    inz(x'FF')
     d ACLP            pr                  extpgm('ACLP')
     d x                              1
     d                sds
     d Status            *status
      /FREE
       dsply '-- Monitor (e)';
       monitor;
       callp(e) ACLP(x);
       dsply Status;
       on-error;
       dsply 'In Monitor (e)';
       endmon;

       dsply '-- Monitor ';
       monitor;
       callp    ACLP(x);
       dsply Status;
       on-error;
       dsply 'In Monitor ';
       endmon;

       dsply '-- Status';
       callp(e) ACLP(x);
       dsply Status;
       if %status = 00202;
       dsply 'In Status';
       endif;
       *inlr = *on;
      /END-FREE

Escape Message ACLP

  PGM PARM(&INC)
  DCL VAR(&INC)        TYPE(*CHAR) LEN(1)
  SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('Failure') +
     MSGTYPE(*ESCAPE)
  ENDPGM

Decimal Date Error ACLP

  PGM PARM(&INC)
  DCL VAR(&INC)        TYPE(*DEC)  LEN(1 0)
  DCL VAR(&SUM)        TYPE(*DEC)  LEN(1)
  CHGVAR VAR(&SUM) VALUE(&SUM + &INC)
  ENDPGM





> > > I have this code which attempts to trap errors that occur
in
> a
> > > called CLP program.  The Monitor fails to catch the error
but
> > > %Status catches it. Why doesn't monitor catch the error?
> > > ...
> > > What am I missing?
> > > ...
> > >  /FREE
> > >   monitor;
> > >   callp(e) ACLP(x);
> > >   on-error;
> > >   dsply 'Monitor';
> > >   endmon;

> > >   callp(e) ACLP(x);
> > >   if %status = 00202;
> > >   dsply 'Status';
> > >   endif;
> > >   *inlr = *on;
> > >  /END-FREE

> > It's not %status that's catching it in the second section,
it's
> the
> > (e).  The (e) is catching it in the first section too.  Try
> this:

> >    monitor;
> >      callp ACLP(x);      // no (e)
> >    on-error;
> >      dsply 'Monitor';
> >    endmon;

> In my original code I didn't have the (e) and it never came
back
> to my RPG.  RPG handler jumped in with RPG0202 and bounced me
> back to my calling CLP. Granted I was running under debug so I
> could create a failure in the called CLP.  So I changed to the
> (e) and found it still didn't work with monitor.  I finally
gave
> up and went to (e) and %status.

> I'll give it a whirl with my (above) test program without the
(e)
> tomorrow.  Maybe I just had a brain spasm...

> Sam

 
 
 

Monitor Bug?

Post by Barbara Morri » Wed, 02 Jul 2003 01:30:27



> I've done some more experimentation, but I'm still confused.  If
> my called CLP has a decimal data error, the monitor fails to
> catch it and I get booted out of the calling RPG because the
> standard RPG error handler gets invoked.  Maybe it is something
> to do with the MCH1202 that comes from the decimal data error.

> If I have the CLP send an escape message, the monitor catches it
> when (e)is not specified.

> %Status catches both the decimal data error and the escape
> message.

Sam, if you make ACLP a CLLE program, the MONITOR catches the decimal
data failure too.  Looks like you've found a bug.  You should contact
service.
 
 
 

Monitor Bug?

Post by Sam L » Wed, 02 Jul 2003 08:09:23


I'll send it in.

Thanks.


Quote:> Sam, if you make ACLP a CLLE program, the MONITOR catches the
decimal
> data failure too.  Looks like you've found a bug.  You should
contact
> service.

 
 
 

1. bug or no bug?

I'm running V4R5 and experience the following problem:

Running the command ENDTCPSVR to prepare for night-jobs
the system posts about 30 messages telling me that job
QP0ZSPWP ended, I just wonder why?

Martin Hinze

2. Atari is a games machine, claims Amiga a

3. performance monitor

4. Floppy drive speed

5. Anyone use SiteScope to monitor an AS/400 and/or JDE World?

6. start mpi in a file

7. Monitor Performance

8. pthread.h

9. printed spool file monitor

10. How to monitor system resource utilization

11. PERFORMANCE MONITOR

12. Distribution Queue Monitor

13. How to Monitor a Library