Page 1 of 1

while passing smallint value to DB2 column getting negetive

PostPosted: Tue Jan 22, 2019 6:58 pm
by thotlma
Hi Everyone

i have defined column as BANK_NO SMALLINT in the one of the DB2 table
i have value 31 for BANK_NO POSITION(196:197) so after successfully completed the job
i have seen value -3087 in BANK_NO filed. could you please help me why iam getting this value in the table?

Re: while passing smallint value to DB2 column getting neget

PostPosted: Tue Jan 22, 2019 7:28 pm
by Robert Sample
The hexadecimal value for -3087 is X'F3F1'. Guess what the zoned decimal value of 31 is? That's right, X'F3F1'. So you need to figure out how to convert zoned decimal to smallint when you load the value into DB2.