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



Barbara,
Thanks a lot for the help.
Here is why I am trying to call a mysterious pgm.
Our product lets users to generate and compile user exit programs to accomplish 
their specific needs. We have 3 standard parms in each pgm: 
Process?/ShutDown?/MessageID and we leave the pgms open until the user session 
ends. If the user already opened a user exit pgm, and then during the same 
session wants to make a change and recompile it, we used to force user to sign 
off and sign on back again, so that the newly compiled user exit pgm is used 
versus the one in the call stack. Our solution was to call the pgm with 
Process=*no/ShutDown=*Yes, and if an earlier release version of the user exit 
pgm (with more parms) exists, expecting it to fail, but was hoping the catch 
the parameter mismatch with monmsg. Having never verified this theory, Murphy's 
"If something can go wrong, it will at the worst possible time" rule once again 
proved to be true.
But the good this is that you are always available to rescue me.

-----Original Message-----
From: Barbara Morris [mailto:bmorris@xxxxxxxxxx]
Sent: Thursday, December 09, 2004 11:57 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Is there any way to monitor parameter mismatch error during
pgmcalls in CL or RPG?


Ali Ekinci wrote:
> 
> In the following CL, I am making a call and expecting MYPGM to have 3 
> parameters, but if the pgm doesn't have the proper parameter list, I just 
> wanna catch it and avoid.
> 
> DCL        VAR(&P#OBJL) TYPE(*CHAR) LEN(10)
>              VALUE('MYLIB') /* Object library
> DCL        VAR(&P#PGMN) TYPE(*CHAR) LEN(10) +
>              VALUE('MYPGM') /* Program name */
> 
> CALL       PGM(&P#OBJL/&P#PGMN) PARM('*NO' '*YES' ' ')
> MONMSG     MSGID(MCH0801 RPG0221 MCH0000 CPF0000 +
>                  RPG0000)
> 
> But unfortunately, when I run the pgm I got the following hard message first. 
> Is there a way to trap this message?
> 

You could change the job to automatically reply with the default reply
to all inquiry messages (CHGJOB INQMSGRPY(*DFT)), or you could use the
system reply list (ADDRPYLE and CHGJOB INQMSGRPY(*SYSRPYL)) to
automatically respond to a particular inquiry message.

If you want to completely avoid the RPG inquiry message from being
issued, you have to use ILE CL and ILE RPG, and have the RPG program in
the same activation group as the CL.  Then your CL would monitor for
RNX0222 (pointer or parameter error).

But why are you trying to call a program with possibly wrong parameters
like this?  When you don't pass the right parameters, there is no
guarantee the program will fail; it may just silently go ahead and do
the wrong thing.

If you can change the RPG program, you can get it to check how many
parameters it received (*PARMS in the PSDS).

--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



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.