This may belong in the DB2 forum but I am using this with COBOL so put it here.
I have a fun problem. I have a COBOL program that is retriving a list of numbers from an Oracle database. Each time it retrieves a new number it puts that number in a comma delimited string with single quotes around each number (ex.. '8','7'). The list is defined as "PIC X(500) VALUE SPACES". When all the numbers are put in the list that varable is moved to another variable that is in a copybook containing working storage elements. That copybook variable is defined as PIC X(500). This copybook is then called in a COBOL program that calls a DB2 select statement. The copybook variable is moved to a local variable defined as "PIC X(500) VALUE SPACES". That local variable is then put in a where clause of a select statement.
My issue is that when the data is returned from that select statement it is like the "not in" statement that list is used in is ignored. I run the query outside of the program in sql/station and it works perfect.
Any ideas or suggestions as to why that not in statment would be ignored? I know this is probably complicated to follow but anything is appriciated.
I have a fun problem. I have a COBOL program that is retriving a list of numbers from an Oracle database. Each time it retrieves a new number it puts that number in a comma delimited string with single quotes around each number (ex.. '8','7'). The list is defined as "PIC X(500) VALUE SPACES". When all the numbers are put in the list that varable is moved to another variable that is in a copybook containing working storage elements. That copybook variable is defined as PIC X(500). This copybook is then called in a COBOL program that calls a DB2 select statement. The copybook variable is moved to a local variable defined as "PIC X(500) VALUE SPACES". That local variable is then put in a where clause of a select statement.
My issue is that when the data is returned from that select statement it is like the "not in" statement that list is used in is ignored. I run the query outside of the program in sql/station and it works perfect.
Any ideas or suggestions as to why that not in statment would be ignored? I know this is probably complicated to follow but anything is appriciated.