Can return codes be checked for Failure or Success Gentran:Director FTP, to prevent premature delete of the send.edi ?
If the FTP could not connect, the scripting was deleting the SEND.EDI file without it actually making it to the destination. This caused confusion and difficultly to find the missing items and retransmit.
Yes. The IBM Sterling Gentran:Director FTP documentation points out that CEFTP.EXE does have error handling. This article attempts to make it simple to follow. Certainly more errorlevel can be implemented as the guide reflects.
Below is an example of the two setup files needed.
The 1st is a .BAT file used to launch the FTP framework, including debugging parms and logging. Within it calls the 2nd file that holds the IP address, logon, password and FTP native parms that you would execute in a FTP scripting situation.
The are also attached to this article.
:Invoke the FTP Option with the Return Code Checking On (-x).
CALL ceftp -a FTP_RC_Check_Step2.txt -i -x -d 2 FTP_RCcheck.log
if errorlevel 4 goto PUTF
if errorlevel 3 goto FAILED
if errorlevel 2 goto FAILED
if errorlevel 1 goto FAILED
if errorlevel 0 goto XPASSED
echo "Account Log did not transfer"
echo "FTP Option experience a failure."
echo "FTP Option subcommand was successful"
delete c:\SEND.edi file