Scope of FROM Clause Extended Reference.


The scope of the extended_entity_ref_id in each extended entity reference in a FROM clause, is the MAP or COMPOSE declaration that contains the FROM clause. These variables can be referenced from the WHEN clause and from any construct in the body of the actual MAP or COMPOSE declaration. It is legal to define another variable with the same name as the extended_entity_ref_id in an inner scope. This should be avoided as it can lead to erroneous mapping schemata, and mapping schemata that is difficult to read and understand.
The value of the extended_entity_ref_id is assigned as part of the iteration created by this FROM clause. The assigned value is the current instance of the type defined by the particular extended entity reference.