Can anyone help with my embedded SQL in a old mainframe COBOL application that also runs on Windows. The SQL that is failing is a pretty standard SELECT and in the WHERE clause I am comparing some date/time columns in the selected rows with a timestamp of two COBOL host variables.

My SQL has been working for 10 years on various releases and still works just fine today on DB2 z/OS 10.1 and ok with SQL Server 2005 and 2008 and on Oracle...