COBOL LOW-VALUE and HIGH-VALUE

Posted by egidio landuzzo on 08-Apr-2016 05:15

Hello,

I'm a consultant and I'm trying to use a trial of your  DataDirect ODBC Wire Protocol to access to DB2 z/OS. In my test I'm using a simple COBOL (Fujitsu) program from a windows PC. I've a strange behaviour using a simple query (I don't know if I'm doing something wrong). The query is something like this:

EXEC SQL

       SELECT * FROM MYTABLE

       WHERE COLUMN1 BETWEEN :HVMIN AND :HVMAX

END-EXEC.

the COLUMN1 is defined as CHAR(4)

Host variable HVMIN and HVMAX are defined as PIC X(4).

If I  MOVE LOW-VALUE to HVMIN and HIGH-VALUE to HVMAX the SELECT returns 0 rows.

if I MOVE "0000" to HVMIN and "9999" to HVMAX the SELECT returns 2 rows.

Using HIGH-VALUE and LOW-VALUE on z/os the same COBOL program returns 2 rows.

Could you help me?

Many thanks

Egidio

All Replies

This thread is closed