The CAST will left justify. e.g. cast(1 as char(3)) will give you '1 '
I am not sure what your exact question is.
Are you trying to have leading zeros for any int number or just for a 3 digit number?
Do you need to handle negative numbers?
Do you need to handle INT column only or decimal/smallint/ect. as well?
For instance:
1 => 001
10 => 010
100 => 100
1000 => ?
-1 => ?
1.0 => ?
If you ever only need up to 3 digits for INT, and do not have negative numbers, you can do:
SUBSTR( DIGITS(int_number), 8)
e.g. select substr(digits(1), 8) from sysibm.sysdummy1 => '001'
--Andrei L.