To return more than 1 parameter in free format RPG

100 pts.
Tags:
AS/400
AS400/RPG
How can 2 parameters be returned from subprocedure in free format RPG.In PR i have to define return parameter.but if i have more than 1 parameter how will i define.Please suggest.
ASKED: November 27, 2012  12:04 PM

Answer Wiki

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

Discuss This Question: 5  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
  • BigKat
    You can only define one parameter as returned directly.  Your options are:  to return a data structure with the multiple parameters defined to code additional parameters (like you would any input parameters) and the result will be passed back to your calling programs variable
    7,585 pointsBadges:
    report
  • TomLiotta
    Are you asking about parameters or return values? You can return as many as perhaps all of the maximum 399 "parameters"; but there can only ever be a single "return value". They are not the same things. In general, when a return value is used, the procedure is a "function". Otherwise it's just a "procedure". A function may be substituted in an expression in order to use the return value. A procedure is called with the CallP instruction. -- Tom
    125,585 pointsBadges:
    report
  • Rr22

    Thanks for the suggestion.I want to retrieve cust code and cust active date from some files.For eg if i am retriveing some date value the i write ABCDate= Getdate( ).for this

    Getdate            PR       8,0.

    In the same way i want to get 2 values one cust code(10) and cust active date(8,0)  then how will i define PR and how will i assign to some other variables.

     

    100 pointsBadges:
    report
  • TomLiotta
    Your Getdate() prototype doesn't show any parameters; it only shows a return value. If you want a procedure to return code and date, then define code and date parameters to be passed by reference. Your procedure will put the two values into the parameters. The values will be passed back to the calling procedure automatically when the called procedure ends. -- Tom
    125,585 pointsBadges:
    report
  • Rr22

    Thanks Tom

     

    100 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