Rick wrote in with this question recently:
"I am trying to automate transferring data from the iSeries to a PC server using FTP. I have built the CL's, the RPG ILE program and the test file. Everything looks good except that when I execute the CL and the program gets to the FTP portion I receive a message, 'You must first issue the User sub command.' I have researched this and have been unable to determine where my file differs from the posted ones. Can anyone give me pointers?"
File Layout =======
FTP 192.168.66.99
USER FTPUser
PASS FRED999
PUT WEBAPP/QRYARMST QRYARMST.TXT
QUIT
======================
-- Deb Tart, associate editor
Software/Hardware used:
ASKED:
February 22, 2006 4:16 PM
UPDATED:
February 23, 2006 10:13 AM
It would appear that the ftp logon and/or password is failing. Therefore, when you issue a subsequent ftp command such as a put or get, the user is not logged on, hence the message- “You must first issue the USER subcommand”
Your ftp script should look something like the follwing:-
*************** Beginning of data ****
0001.00 tom TOMSpwd
0002.00 ascii
0003.00 cd /fnx/fx/import
0004.00 put phdixtro.phdixtro ibisrolls.txt
0005.00 quit
********* End of Data ***********
Line 0001.00 logs on to the remote site with user and user password. If the User does not exist or the password is incorrect, you will get the “issue the USER subcommand” message when it tries to execute line 0002.00
I hope this helps
What they said was correct. To clarify, in your case,
the infile CL should be:
—————
FTPUser FRED999
put webapp/qryarmst qryarmst.txt
quit
—————
The outfile should be an empty cl member that you will want to clear periodically.
the calling cl should be something like:
—————
ovrdbf file(input) tofile(library/qclsrc) mbr(infile)
ovrdbf file(output) tofile(library/qclsrc) mbr(outfile)
ftp rmtsys(’192.168.66.99′)
dltovr *all
—————-
Barnes
if you put of this form:
UserID Password