Datastage 8.1.1 Bug
Posted: Fri Oct 15, 2010 11:55 am
We just applied Datstage 8.1 Fixpack 1 on our AIX server and found one rather disheartening bug, and i thought I'd report it here as well.
We have some old table definitions in DB2 where the datatype was foolishly set to char instead of varchar, and we haven't honestly gotten around to converting them to varchar.
Anyway, the datstage job took varchar source fields and inserted them into char target fields.
The column definitions for the source stage was varchar, and the column definitions for the target stage was char.
Datastage pads space in the char field with ascii nulls. (chr(0))
So effectively before patching, when we did a "select length(fieldname) from tablename) for a 6 character value in the char(12) field, you'd get 6. Now it actually returns 12.
Even worse, this is a primary key field. So even queries like "select * from table where pk=val" did not work any more. We had to do a mass update statement to clear it all up, but it's still worth noting.
Double check before applying this patch that you don't have any char datatypes that are narrower than the field width. It will mess up your data and make it useless.
For example, for whatever reason the people who designed this table set country code to be char(6) even though it should be a char(2) field. So doing a basic "select * from table where country='US' " would return zero rows because it's all right padded with ascii nulls.
This is an unacceptable bug IMO. We're logging a ticket with IBM right now.
We have some old table definitions in DB2 where the datatype was foolishly set to char instead of varchar, and we haven't honestly gotten around to converting them to varchar.
Anyway, the datstage job took varchar source fields and inserted them into char target fields.
The column definitions for the source stage was varchar, and the column definitions for the target stage was char.
Datastage pads space in the char field with ascii nulls. (chr(0))
So effectively before patching, when we did a "select length(fieldname) from tablename) for a 6 character value in the char(12) field, you'd get 6. Now it actually returns 12.
Even worse, this is a primary key field. So even queries like "select * from table where pk=val" did not work any more. We had to do a mass update statement to clear it all up, but it's still worth noting.
Double check before applying this patch that you don't have any char datatypes that are narrower than the field width. It will mess up your data and make it useless.
For example, for whatever reason the people who designed this table set country code to be char(6) even though it should be a char(2) field. So doing a basic "select * from table where country='US' " would return zero rows because it's all right padded with ascii nulls.
This is an unacceptable bug IMO. We're logging a ticket with IBM right now.