FTP426 error when using FTP command in a batch file and running the batch file from AS/400

5 pts.
Tags:
AS/400
Batch files
FTP
Getting FTP426 error when using FTP command in a batch file and running the batch file from AS/400. The same batch file run in Command prompt it works fine. Here is the code.
 
FTP.CMD file to IFS Folder
 
open AS400
User AS400USER
password
quote pasv
quote site namefmt 1 
bin
lcd A:
cd /AS400USER 
put PcFile.csv As400file.csv
disconnect
quit
 
c:WindowsSystem32ftp.exe -n -s:ftp.cmd > ftp.log
--------------------------------------------------------------------------------------------------------
 
Ran this command in PC Command line it works great.
 
Here is the log which ran successfully from PC Command line.
 
FTP.LOG file
 
ftp> Connected to AS400.
open AS400
220-QTCP at AS400.
220 Connection will close if idle more than 5 minutes.
ftp> User AS400USER 
331 Enter password.
 
230 AS400USER logged on.
ftp> quote pasv
227 Entering Passive Mode (xxx,xxx,xxx,xxx,xx,xxx) (IP Address is hidden).
ftp> quote site namefmt 1 
250  Now using naming format "1".
ftp> bin
200 Representation type is binary IMAGE.
ftp> Local directory now A:.
ftp> lcd A:
cd /AS400USER 
250 "/AS400USER" is current directory.
ftp> put PcFile.csv As400File.csv
200 PORT subcommand request successful.
150 Sending file to /AS400USER/As400File.csv 
226 File transfer completed successfully.
ftp: 349 bytes sent in Seconds Kbytes/sec.
ftp> 0.231.53disconnect
221 QUIT subcommand received.
-----------------------------------------------
 
 
Put the same ftp in a batch file and ran using STRPCCMD in AS/400 command line it is giving the FTP426 error.
 
From AS/400 command screen or from CL program.
 
STRPCO
STRPCCMD PCCMD('A:')
STRPCCMD PCCMD('start ftp.bat').
-------------------------------------------------
Here is the batch file FTP.BAT
 
A:
c:WindowsSystem32ftp.exe -n -s:ftp.cmd > ftp2.log
---------------------------------------------------
 
Here is the log file for batch command.
 
ftp> Connected to AS400.
open AS400
220-QTCP at AS400.
220 Connection will close if idle more than 5 minutes.
ftp> User AS400USER 
331 Enter password.
 
230 AS400USER logged on.
ftp> quote pasv
227 Entering Passive Mode (xxx,xxx,xxx,xxx,xx,xxx) (IP Address is hidden).
ftp> quote site namefmt 1 
250  Now using naming format "1".
ftp> bin
200 Representation type is binary IMAGE.
ftp> Local directory now A:.
ftp> lcd A:
cd /AS400USER 
250 "/AS400USER" is current directory.
ftp> put PcFile.csv As400File.csv
200 PORT subcommand request successful.
425 Not able to open data connection.
ftp> disconnect
221 QUIT subcommand received.
ftp> quit

Answer Wiki

Thanks. We'll let you know when a new response is added.

Check out this link. Microsoft 426 error.

It may have something to do with the IIS settings.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • pdraebel
    Could be a Firewall issue. Google FTP 425 error iSeries for a list of  possible solutions
    7,545 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: