You can look at the IML doc on this at SAS/IML(R) 12.1 User's Guide to get the full explanation on how to specify global and local variables. Basically, local variables are used inside a module when you want to encapsulate those calculations so that you know what the inputs and outputs are and don't want to affect any other variables outside that module. Global variables exist above the scope of the module, and can be accessed inside a module if its definition doesn't have any parameters, or if they are specified explicitly with a global clause, such as start foo; /* all variables inside foo are global */ or start foo(a,b) global(m); /*a and b and any other variables inside foo are local, except that m is global */ Global parameter are useful for common data that may be used across several modules, but should be used with care. It is easy to introduce obscure errors in your program by accidentally modifying a global parameter that is normally assumed to be constant.
... View more