shell script with If then else

Hii frds,
I am trying to write a shell script to display the date based on user input. I am geting syntax error. plz help. thanks - sam

UNIX version: AIX

#!/bin/ksh
echo -n "todays date want to know:"
set answer = $<
if ($answer == yes) then
date
exit 1
else
exit 2
endif

-n todays date want to know:
date1[3]: 0403-057 Syntax error at line 4 : `newline or ;' is not expected.

Still unable to fugure out. looking for help

Hope this helps:

#!/bin/ksh

echo -n "todays date want to know: "
read answer

if [ $answer == "yes" ]; then
date
exit 1
else
exit 2
fi

Thanks man it did work. I appreciate u r help.

Solution:

#!/bin/ksh
echo -n "todays date want to know:"
read $answer
if(answer==yes)
then
date
exit 1
else
exit 2
fi