On 28/09/2009, at 9:51 PM, David FOXWELL wrote:
Thanks, I'm reading Who Knew You Could Do That with RPG IV and  
wondering why I would use binder source to limit the number of  
procedures available. Why would you have an exported procedure if it  
wasn't available?
A procedure without EXPORT is only visible within the containing  
module. If you have a program or service program containing multiple  
modules and one module needs to call a procedure in another module  
bound-by-copy then you need EXPORT to make it visible. Same for data  
unless passed as parameter.
All procedures with EXPORT are candidates for the public interface. If  
you specify EXPORT(*ALL) when creating a service program then all  
those candidate procedures plus any data exports become part of the  
public interface. The members of the public interface are used to  
calculate the service program signature. Whenever you add a new export  
a new signature will be created. No previous signatures will be  
supported and you will have to recompile all consumers of the service  
program.
Using binder source to limit the exports in the public interface gives  
three levels of visibility:
	1) Private to the module
	2) Private to the service program
	3) Public
It also gives the ability to support either different (i.e., previous)  
signatures or a single signature which means I don't have to recompile  
any consumers of the service program if they don't need to use any of  
the new exports.
Also, it suggests to use binder source and not use EXPORT(*ALL). I'm  
confused.
Never use EXPORT(*ALL). Search the archives for previous discussion on  
why that's a stupid thing to do.
Program code is demand paged so only a small proportion
of the program code will be in main storage at any one time.
Program code is shared between users. All static variables
will require separate storage in each job.
Looked closer at the 2 versions of the program and found in program  
statistics, static memory size has gone from 19872 to 4441296. Is  
that worse? That's 223 times more.
You went from a program with one module to a program with many  
modules. Each module will have it's own storage requirements.  
Obviously more modules equals more storage. However, that storage  
would be used regardless of how you bound the modules. That is, it  
would be used in any program that contained those modules. It's not  
necessarily worse.
Regards,
Simon Coulter.
--------------------------------------------------------------------
   FlyByNight Software         OS/400, i5/OS Technical Specialists
   
http://www.flybynight.com.au/
   Phone: +61 2 6657 8251   Mobile: +61 0411 091 400        /"\
   Fax:   +61 2 6657 8251                                   \ /
                                                             X
                 ASCII Ribbon campaign against HTML E-Mail  / \
--------------------------------------------------------------------
 
As an Amazon Associate we earn from qualifying purchases.