Joined: 06 Jan 2004 Posts: 247 Location: Hyderabad
ALPHANUMERIC ITEMS ARE LEFT JUSTIFIED.For example: the word SAR in a 5 character alphanumeric field would be stored as "SAR ". The number 1201 in a 7 character alphanumeric field would be stored as "1201 ". the contents are left justified with trailing spaces.
NUMERIC DATA TYPES(9) ARE RIGHT JUSTIFIED.The entire field contains zeros if unused (blanks are not allowed). If larger than 1 digit, the contents are right justified with leading zeroes. For example: the number 1201 in a 7 character numeric field would be stored as 0001201
SO WHEN num1 = 0001500 ,WHICH IS DECLARED AS 9(7) IS MOVED TO ans1 which is x(8),
it will be stored as "0001500 ".
hence when u moved it back to num1 it will consider last 7 values including space "0001500 ".hence u r getting num1 as 001500.