When running a query the full set of results is not returned to the COBOL program but in other cases the full set of results is returned.
We are having collating sequence issues in Enterprise Server JCL with UDB. When running a query such as "Select * from tab1 where col1 between LOW-VALUES and HIGH-VALUES" the full set of results is not returned to the COBOL program. When running a query such as "Select * from tab1 where col1 between x'00' and x'ff'" using QMF or the DB2 command line, the full set of results is returned.
The UDB database was defined using a non-native codepage (850), while Enterprise Server was using the default (native codepage) 819. Setting the environment variable DB2CODEPAGE=850 prior to starting the Enterprise Server JCL region resolved this discrepancy. When this environment variable must be set is dependent on how the Enterprise Server JCL region is started. If the region is started from the Enterprise Server Admin page, then DB2CODEPAGE must be specified prior to Micro Focus Directory Server (MFDS) being started, or it must be specified in the [ES-Environment] configuration section of the region definition. If the region is started from the command line, DB2CODEPAGE must be set prior to the region being started. Ultimately, the database was redefined using the native codepage and the use of the DB2CODEPAGE environment variable was no longer required. For more information regarding DB2 and codepages reference see the IBM documentation at http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/ad/c0006825.htm.