# Advantages of Internal Procedures

Functions or subroutines that are used in only one program can be organized as internal procedures, following the CONTAINS statement of a program or module.

Internal procedures have the advantage of host association, that is, variables declared and used in the main program are also available to any internal procedure it may contain. For more information on procedures and host association, see Program Units and Procedures.

Internal procedures, like modules, provide a means of encapsulation. Modules can be used to store routines commonly used by many programs; internal procedures separate functions and subroutines whose use is limited or temporary.

Parent topic: Program Structure

## See Also

CONTAINS statement
Program Units and Procedures