It would be easier to use:
Code:
ssh-t user@hostename /usr/bin/sudo sh -c "cat >/etc/sysconfig/sysstat" <<-EOF
#How long to keep log files (days), maximum is a month
#Change no 123456789 dated on 3rd April 2013
HISTORY=30
EOF
The blanks at the beginning of the lines is a "tab" character.
man bash, and look for "here documents"