0 pts.
 Automate transferring data from the iSeries
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

Answer Wiki:
We ftp files in batch on a regular basis. We do it through the use of source files to get the actual commands to run. I am attaching the CL and the source file we use to do this as an example. PGM OVRDBF FILE(INPUT) TOFILE(FABRICLIB/QTXTSRC) + MBR(MAHINPUT) OVRDBF FILE(OUTPUT) TOFILE(FABRICLIB/QTXTSRC) + MBR(MAHOUTPUT) FTP RMTSYS(FTP.INTFABGRP.COM) /* SEND FILES TO + THE FTP SERVER */ The input source file contains the following as400 as400 cd /maharam PUT FABGPL/MAHRECVP MAHRECVP.TXT quit The top 2 lines are the user id and password. The output source file contains the ftp log so you can view any errors etc. Hope this helps.
Last Wiki Answer Submitted:  February 23, 2006  7:18 am  by  Fabrics   0 pts.
All Answer Wiki Contributors:  Fabrics   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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


 

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

 0 pts.

 

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

 0 pts.

 

if you put of this form:
UserID Password

 0 pts.