Carolly,
there are basically three ways of using a sub program:
1. including the code in the same source as the main program; in this way, they are compiled together in one object.
2. statically linking the object together with that of the main program into one executable; the location of the sub-program object has to be known at compile-time.
3. dynamically calling the sub-program.
Only in the last way there is actually a seperate object needed at run-time. The environment you are working in determines where that object should be, and how it is found.
Using JCL, for instance, the libraries / directories where called objects can be found are listed in the job.
Hope this helps; if not, please get back with us.
Regards,
Ronald.