IBM Support

RNF3751 When Trying to Compile a ILE RPG IV Program

Troubleshooting


Problem

The following document explains how to fix the RNF3751 error message when compiling an ILE RPG IV program.

Resolving The Problem

Disclaimer: This is only an example. IBM accepts no responsibility for its correctness.

The following will explain how to fix the error RNF3751.

For example, you have one ILE RPG IV program that calls another ILE RPG IV  program and passes parameters.

RNF3751 30 1 External procedure on prototype for main procedure is not same as actual external name.

The first ILE RPG IV program is called SEARCHME1, which has a EXTPGM calling SEARCHME2 and passes two parameters.
**FREE
Dcl-Pr Searchcna Extpgm('SEARCHME2');
  *n              Packed(2:0);
  *n              Packed(9:0);
End-Pr;
Dcl-S $Xacmp          Packed(2:0);
Dcl-S $Xanumber       Packed(9:0);
$Xacmp = 1;
$Xanumber = 123;
Callp Searchcna($Xacmp:$Xanumber);
*INLR = '1';   
The second RPG ILE program is called SEARCHME2.
**FREE
Ctl-Opt DftActGrp(*No);
Dcl-Pr SEARCHME;
  *n              Packed(2:0);
  *n              Packed(9:0);
End-Pr;
Dcl-Pi SEARCHME;
  $Xacmp          Packed(2:0);
  $Xanumber       Packed(9:0);
End-Pi;
$Xacmp = 02;
$Xanumber = *zeros;
//
Return;   
Both the programs are compiled with the CRTBNDRPG command. The SEARCHME2 compile will fail with the RNF3751. The message RNF3751 says external procedure on prototype for main procedure is not the same as the actual external name. The reason is because the PR and PI have to be the same name as the program.

The following code will fix the problem and the program will compile:
Dcl-Pr SEARCHME2;
Dcl-Pi SEARCHME2;
**FREE
Ctl-Opt DftActGrp(*No);
Dcl-Pr SEARCHME2;
  *n              Packed(2:0);
  *n              Packed(9:0);
End-Pr;
Dcl-Pi SEARCHME2;
  $Xacmp          Packed(2:0);
  $Xanumber       Packed(9:0);
End-Pi;
$Xacmp = 02;
$Xanumber = *zeros;
//
Return;  
                            
You must have the calling program's PR and PI be the same name as the program name, which is SEARCHME2.

Note: In the program SEARCHME1 (first RPG program), the PR and CALLP can have Searchcna.
It is SEARCHME2 that must have the PR and PI the same name as the program name, which is SEARCHME2

[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CHtAAM","label":"Programming ILE Languages"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]

Historical Number

494740307

Document Information

Modified date:
18 November 2024

UID

nas8N1013543