Page 1 of 1

Problem in FTP_list

Posted: Thu Aug 03, 2023 3:18 pm
by alex.cari
I've encountered problems in the FTP_list function in the *SRVPGM.
Contacting an FTP server with FileZilla on UNIX it gave no problems asking for the file list with "*.TXT"

Code: Select all

eval $Rc = ftp_list($Fd:%trim($FilesTXT):100: %addr($FilesName): $FilesNumber
I'm now testing a new Azure based server where the Filezilla server version is different and no longer accepts the "NLST *.TXT" command. I then corrected the program by passing the parameter to blank:

Code: Select all

eval $Rc = ftp_list($Fd:' ':100: %addr($FilesName): $FilesNumber
This should make me the list of all the files, then the code will read only the "TXT".
With this solution the program goes into TIMW state for about a minute then returns "$RC = -0000000001".
Thanks and sorry for my bad english

Re: Problem in FTP_list

Posted: Wed Aug 09, 2023 12:53 am
by Scott Klement
That sounds like it's unable to make a connection to the FTP server to download the files, so it sits there for a minute until it times out, then fails.

This is just a guess because you haven't told us much -- just that there's a delay and then you get -1.

By default, FTPAPI writes diagnostic messages to the job log that show what is going on during the FTP communications. Can you look at these messages in your job log and see what is happening?