Referencing Variables and Scope
The compound statement block in which a variable is declared defines its scope. Variables with the same name that have been declared in an outer level block are not visible to the inside block. However, if the outer compound statement BEGIN had a label then the outer variable can still be referenced by qualifying it with the label: "label.varname". This applies as well to compound statement blocks defined by labeled control statements (see next section).
Procedure and function arguments also can be explicitly referenced by qualifying the variable name with the procedure name: procname.varname.
Global variables can be explicitly referenced by prefixing the variable name with "@": @varname.
These scoping rules were illustrated in the earlier var_refs procedure example.