ILE Program won’t compile

5 pts.
Tags:
AS/400
RPGLE
Hi, I'm just starting to get into ILE and i've created a Module with a with a Prototype, Procedure and Procedure-Interface definition. The problem is program from where i am trying to call the procedure. I won't compile. I get the error "The name or indicator is not defined." There some where in the calling program that i should be defining the Prototype? Here is the source to my Module: H NOMAIN ************************************************************************* * Pgm Name: NEX100M SRCLIB: SPLPGM * * * ************************************************************************* DRtAdj24 PR 24 Dwrk24a 24 VALUE PRtAdj24 B EXPORT ************************************************************************** ** RtAdj24 - Right adjust information coming in to a 24 byte field. ************************************************************************** DRtAdj24 PI 24 Dwrk24a 24 VALUE Dwrk24b s 24 D#strpos s 2 0 Dr01 s 2s 0 Dr02 s 2s 0 c ' ' scan wrk24a r02 c eval r01 = r02 -1 c if r01 = *zeros c eval r01 = 1 c endif c eval #strpos = %SIZE(wrk24a) - r01 c RETURN %SUBST(wrk24b:#strpos+1:r01) = wrk24a * C *PSSR BEGSR C RETURN *blanks C ENDSR * PRtAdj24 E Here is the source from the program calling the procedure: c* c From_Num BEGSR c eval s = j - I * *** To Right Justify wrk24a into tlfrnb c eval wrk24a = %subst(f1:I:S) c eval wrk24b = Rtadj24(wrk24a) c move wrk24b tlfrnb c* c EndSR
ASKED: April 28, 2006  4:45 PM
UPDATED: December 6, 2009  10:58 AM

Answer Wiki

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

Your error usually comes for me when I forget to include the service program containing the procedure th program uses. I forget to put it in the binding directory.

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

Yes, the calling module needs the same prototype in order to compile. The prototype (the PR specs) can be in the global area of the module or inside any procedures in the module that make the call.

It doesn’t matter if the target procedure is in a service program or in another module bound into the same program. The compiler needs the prototype to compile both the calling and the called modules.

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
  • Slaliberte
    Hi, How do i add the service program containing the procedure to the binding directory?
    5 pointsBadges:
    report
  • TimRac
    To get the program to recognize a procedure in a service program: 1. Make sure your service program is compiled. 2. Create a binding directory and then work with the binding directory (WRKBNDDIR) to add the service program to the bindig directory. Enter a 9 to work with the binding directory and then F6 to add the service program. (Make sure you enter *SRVPGM qand not *MODULE). At the top of your program using the procedure in the service program, enter an "H" spec containing BINDIR('YOURBNDDIR'). 3. You may also need an export file.
    25 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