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,
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’.