I am working on a data upgrade issue.
A new column has been added to our Existing DB2 table.
In order to upgrade Client's DB2 table, I am unloading the data from the existing DB2 table with a constant value for the new column(lets say D of type SMALLINT) as shown below:
UNLOAD TABLESPACE XYZ.ABC
DELIMITED COLDEL X'2C' CHARDEL X'22'
PUNCHDDN SYSPUN01
UNLDDN SYSREC01 CCSID(367)
FROM TABLE DB2BG111.table_name
(
A POSITION(*) CHAR(2)
, B POSITION(*) SMALLINT
, C POSITION(*) CHAR(4)
, D (new column) CONSTANT X'0000'
)
While unloading the data, we are using following unload parameters:
X'2C': Column Delimiter
X'22': Character Delimiter
CCSID(367): EBCDIC to ASCII conversion
Problem tham I am facing is, DB2 is adding character delimiter X'22' after the value of the column D in the unload record.
Please note column B is an existing column and is declared as SMALLINT, DB2 not adding character del for this in the unload record.
This may be happening because new column D added here is not declared as a SMALLINT and hence it is not treated like an SMALLINT and DB2 is ending a char del for this in the unload record.
I am just looking for a way to get out of this situation, i do not want my new column D to be character delimited in the unload record.
Any suggestions to overcome this would be highly appreciated.