Can return codes be checked for Failure or Success Gentran:Director FTP, to prevent premature delete of the send.edi ?

Technote (FAQ)


Question

Can return codes be checked for Failure or Success Gentran:Director FTP, to prevent premature delete of the send.edi ?

Cause

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.

Answer

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.


FTP_RC_Check_Step1.BAT

@echo off
:
: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
goto FAILED

:PUTF
echo "Account Log did not transfer"
goto END

:FAILED
echo "FTP Option experience a failure."
goto END

:XPASSED
echo "FTP Option subcommand was successful"
delete c:\SEND.edi file

goto END

:END


FTP_RC_Check_Step2.txt
locsite unsecure
open 209.95.224.133
ID
PASSWORD
lcd "\\FTP\Sterling\Out"
put c:\Send.edi

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

Sterling Gentran:Director
Documentation

Software version:

5.4, 5.5

Operating system(s):

Windows

Reference #:

1634913

Modified date:

2013-04-22

Translate my page

Machine Translation

Content navigation