Observation: Multiple Uniqueness Clauses

You coded more than one clause that might require DB2 to invoke a sort to group and eliminate duplicate rows. These clauses include DISTINCT and UNION. Since a single sort is sufficient to remove duplicates, consider removing any DISTINCT clause and recoding all but one UNION clause as UNION ALL, which does not require a sort.