Hi,
INT4 uses 4 bytes for storage i.e it can storage range is 2^32. While INTTYPE 'X' uses 1 byte so its storage capacity is 2^8 i.e 255. That is why when you tried to store 341, it went out of its capacity and it showed up a garbage value, and when INT4 was used, as it is in its capacity it was displayed corretly.
datatype 'I' or INTTYPE 'INT4' both use 4 bytes for storage so have capacity as 2^32.
Using 'I' instead of 'X' wont have any problem in storing values, just it will use more memory i.e 4 bytes than 'X' which uses 1 byte.
Regards,
Ashish Rawat