20 pts.
 ftp error codes
Hi! I'm writing a program that needs to execute the FTP command n times (where n is determined by the value of some field in a DDS table), only if there is an error during one of those executions. The question is: how can I determine if the execution failed? Thanks a lot! :) Meli

Software/Hardware used:
ASKED: January 31, 2006  2:25 PM
UPDATED: March 28, 2006  6:34 AM

Answer Wiki:
Meli, The FTP will produce a log file which you can interogate with an RPG program to see if any of the return codes are in the 500 and up range. Those are errors.
Last Wiki Answer Submitted:  January 31, 2006  2:38 pm  by  Ricksmith   0 pts.
All Answer Wiki Contributors:  Ricksmith   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

The first respondant is correct. We assume you are running scripts from a source file. Assume you are overriding output to a source file also. Two options (1) write a program to scan for the error message you want, and scan the output log after each iteration, or (2) write a trigger program to scan each incoming line for the error message you want. Then add the trigger program to the output file receiving the output log.

 0 pts.

 

Hi,

Is there any other way outside from checking the FTP log?
Understand that FTP command does not have any escape log.

Rgds,
SK

 0 pts.

 

Hi

Scott Klement has an open source project, FTPAPI, that allows you to perform FTP processes from within your program. Any errors in the process are trapped and returned to your program.

You can download the tool from his website at http://www.scottklement.com/ftpapi/

All the best

Jonathan

 370 pts.