70 pts.
 RPG/400 – return parameters
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?

Software/Hardware used:
ASKED: May 22, 2008  8:07 AM
UPDATED: April 21, 2010  8:28 AM

Answer Wiki:
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
Last Wiki Answer Submitted:  April 21, 2010  8:28 am  by  Gilly400   23,625 pts.
All Answer Wiki Contributors:  Gilly400   23,625 pts. , Mohan K   695 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _