The problem is that you are using order by
and fetch first
in a subselect - which is a feature that has not existed before version 9 of DB2 for z/OS:
In prior versions of DB2 for z/OS, the ORDER BY and FETCH FIRST
n
ROWS
ONLY clauses were supported only at the statement level as part of
select-statement or a SELECT INTO statement. Version 9 delivers additional
flexibility by allowing both FETCH FIRST
n
ROWS ONLY and ORDER BY clauses
when they are specified as part of a subselect or a fullselect statement.
(DB2 Version 9.1 for z/OS - What's New? GC18-9856-12)
Obviously your DB2-installation is still running in compatibility mode and has not been switched to new-function mode, so this feature is not yet available.
Please note that your installation has a more severe problem than CM <-> NFM since
Support for DB2 for z/OS Version 9 was discontinued on June 27, 2014.