Giving input through script

Script 1.ksh

/home/adw/a.ksh << **
a
b

Script 1.ksh is working fine even without ending "**"

Script 2.ksh

if [ "1" -eq "1" ] then
/home/adw/a.ksh << **
a
b
fi

But the script 2.ksh is giving error "syntax error : `<<' unmatched".
Is it bcoz of fi.

Yes, it is because of the fi. You have to change the script 2.ksh as:

if [ "1" -eq "1" ] then
/home/adw/a.ksh << **
a
b
**
fi