CDISP0866E

For the subclause subclause of the window definition, the expression expression must not reference an input stream.

The subclause for the window clause cannot reference an attribute from an input stream.
Ensure that the expression does not reference the input attributes.