Prototyping and passing parameter in ILE RPG

Tags:
AS/400
ILERPG
RPG
d ipms01 PI
d sen 25a
I have used the above syntax of protype interface to get parameter. While receiving the value through parameter passing in sen variable, I get source and lib name attached with the data I have given for sen variable. Eg: I have given 'New York' through parameter passing but I receive 'New York glesrc aminem' Please guide or sort out this problem
1

Answer Wiki

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

d ipms01 PI 

d sen 25a
 I have used the above syntax of protype interface to get parameter .While receiving the value through parameter passing in sen variable, I get source and lib name attached with the datia have given for sen variable
Eg: I have given ‘New york’ through parameter passing but i receive ‘New York       glesrc aminem’ 




Please guide or sort out this problem

Discuss This Question: 8  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.
  • CharlieBrowne

    Check the program that is calling this proc.

    Either the field length is too small or you are not clearing out the data that is in the field when you are populating it with the new value.

    62,385 pointsBadges:
    report
  • philpl1jb

    What is actually "passed" is the address to a location.

    Your procedure is mapping the next 25 characters as the field sen.

    As Charlie Brown stated the calling program isn't managing the 25 characters properly .. either the 25 aren't all mapped or something is overlaying part of the 25 with other data.

    54,090 pointsBadges:
    report
  • ToddN2000
    You could try debugging the process and find your issue. Like the others stated, you most likely are not reinitializing your parameter and have leftover data.
    135,295 pointsBadges:
    report
  • pdraebel
    The Garbage you get in the input parameter is probably caused by the Calling program not using the correct parameter lenghts.
    7,545 pointsBadges:
    report
  • Gopinath0077
    Yeah, thank you all..

    related doubt:

    but when I am actually trying to increase the parameter value in the calling program (like 50).. i throw me a error as 'Display Length is greater than maximum allowed.' 

    Why i'm unable to specify this value to the parameter.. if it has max allowed value, then tell me the value..


    Thank you for your response
    60 pointsBadges:
    report
  • CharlieBrowne
    Check your source and target parms again. If you do no see the issue, please post your code
    62,385 pointsBadges:
    report
  • philpl1jb

    It appears that you are using a display command in your program and on compile you're getting the message:

    *RNF7016 20 1 Display Length is greater than maximum allowed.

    The longest field that can be displayed is 40 characters.

    Display is generally used as a debug tool.

    54,090 pointsBadges:
    report
  • philpl1jb

    You could move the first half to one variable to display it and follow that by moving the second half to another variable to display that


    54,090 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.

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

Following

Share this item with your network: