RPG/400 – return parameters

70 pts.
Tags:
AS/400
RPG
RPG/400
Since we can pass parameters to a RPG program using *ENTRY and PLIST, Is it possible for a RPG program to return back any values to the calling program? Suppose I want to have a module which checks if a year is leap or not, I am bound to have this as a Subroutine and not as a program being called from different other programs? Is there a way out to handle such kind of modules?

Answer Wiki

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

Hi,

You can return values to calling programs in RPG, <a href=”http://publib.boulder.ibm.com/infocenter/systems/scope/i5os/index.jsp?topic=/rzasd/sc092508989.htm&tocNode=int_236824″>RPG PARM Details</a>

If you have a subroutine for checking leap year that you want to use often, you could incorporate this module into a service program which you could use from your other programs, or as a module that you could bind when you need it.

Hope this helps,

Martin Gilbert.

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

If a program is called with a parameter list (*ENTRY/PLIST), the program can (usually) simply change the value of a parameter. When the called program ends, the calling program will see that the parameter variable has a new, changed value.

Programs are called with parameters ‘by reference’ by default, rather than ‘by value’.

Tom

Discuss This Question:  

 
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

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