how to get error return code

I have a unix AIX script that ftps some files (mput, mget). How can I check (in the script) to see if the ftp failed? After the ftp I move the files out of the directory but do not want to move files that have not been sent. The script will run as a cron job.

You will have to have ftp write to a log. It uses returns codes like 101 and 203.
You'll have read thru the log to interpret them.

http://www.the-eggman.com/seminars/ftp\_error_codes.html

However, if you can come up with some kind of unique file naming convention or delete all of the files in the destination directory (maybe create a special /tmp directory that you can clobber when you're done), then you can simply test for the size or existence of the file(s) using

[ -f filename ] and [ -z filename ]
and you can skip all of the logging nonsense

I appreciate your taking the time to suggest an option. Gives me something to play with.