Need help figuring out compile error

435 pts.
Tags:
AS/400
RPG
Bob needs help figuring out this error he keeps receiving. He is writing a free-form RPG program, and he needs to use CALLP, prototypes, etc., to call another RPG program, passing parms both ways. The called program is also called by many other legacy programs using CALL. The compile error he gets is RNF3751 'External procedure on prototype for main procedure is not the same as actual external name'. He says, "My references do not seem to cover exactly what I'm trying to do, and I don't understand what needs to be done. Are there any code examples out there that apply to this situation?" -- Michelle Davidson, editor, Search400.com

Answer Wiki

Thanks. We'll let you know when a new response is added.

It’s possible that the program he is trying to call is an OPM program, or an ILE program that was compiled using CRTBNDRPG.

In the first case, only CALL can be used. In the second, he could use DSPPGM to find out the procedure names and try those — but best to just use CALL rather than CALLP. It’s obvious that the called program was not written with procedure-type calls in mind.

I don’t use free-format RPG, so I am not sure whether CALL with a parameter list is supported inside it — he may have to drop out of free-format to do the CALL.

============================================================

CallP can be used for programs or procedures, OPM or ILE. If it’s a prototyped call, then CallP is necessarily required.

The problem is that the procedure prototype definition is wrong (or the CRTRPGMOD or CRTBNDRPG is wrong). The <help> text for the message tells what needs to be done. View the compiler spooled file in SEU, have SEU locate the error by entering “*err” in the SEU command area and press <Shift-F4> (or <F16>). When the RNF3751error is located, place the cursor on the message and press <F1>. The <help> text will show:
<pre>
Cause . . . . . : The procedure specified on the prototype definition for
the main procedure must be the same as the program or module being created.
The name specified on the prototype definition is the value of the EXTPROC
keyword, or if the EXTPROC keyword is not specified, it is the name in
positions 7 – 21, in uppercase. The procedure interface definition is
ignored.
Recovery . . . : Change the external name specified on the prototype or
specify a different name on the CRTBNDRPG or CRTRPGMOD command. Compile
again.
</pre>
Or you could always just look up the message identifier in the message file. These compiler messages are in message file QRPGLEMSG in library QDEVTOOLS.

Tom

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • MichelleDavidson
    John Paul Lamontre also writes: In the calling program the pr doesn't match the pi. Sample for program jpl020r2 : d jpl020r2 pr d paok 1 d jpl020r2 pi d paok 1
    435 pointsBadges:
    report
  • pdraebel
    My guess is its a case of case, meaning UPPERCASE. Main pr EXTPGM('DLTLF200') The extpgm name must be specified in uppercase.
    2,675 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following