FTP script debugging

Hello all,

I am trying to run a script and have not had much success running it...ne help debugging it will be appreciated..The ftp script alone works but not within the while loop.

below is the script

#!/usr/bin/ksh
destination_server=servename
destination_user_id=un
destination_password=pw

myfile=/dir1/xxx.dat
while true
 do
  if [[ -a $myfile ]]; then
    echo "$myfile exists!"
    ftp -v -n $destination_server <<END
     user $destination_user_id $destination_password
     cd dir3
     put $myfile
    END
    
    echo 'FTP Complete'
  else
    sleep 600
  fi
done

I am getting the error

0403-057 Syntax error at line 12 : `<' is not matched.

Okay works now:
For others who are looking for this--
0403-057 Syntax error at line nn : `<' is not matched.

This is returned when using <<EOF, << EOF, <<-EOF, <<! etc. and all of the
permutations of syntax that preceed/follow.

If you are also finding this is a problem, I have managed to get around this by
wrapping the sql in a process to returning a value e.g.

ORA_RC=`$ORACLE_HOME/bin/sqlplus /nolog <<EOF
connect /as sysdba
................
EOF`