Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

subprogram / mudule/ service pgm , which one?

Status
Not open for further replies.

thelearner

Programmer
Jan 10, 2004
153
US
Hi,

Between these 3:
1.Subprogram (a pgm that is called by calling pgm but not bound with the calling pgm, just like in OPM.
2.Module(bind by copy)
3.service pgm( bind by reference)

In what kind of case I should use which one of the above?
What's the preference?

Thanks
 
Bind by copy: Fastest because it binds at compile time (a copy of the module is in the pgm). Best for static procedures that are unlikely to change. Like date conversion, for example.

Service pgm: It binds at run time. Allows you to change the module, without having to find every pgm that referenced it.

Sub-Program: Better for seldom used modules, perhaps? Most important, runs in default ILE environment, and so can be used in shops that are using RPG-IV, but haven't implemented ILE.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top