Automate transferring data from the iSeries

0 pts.
Tags:
Application development
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
ASKED: February 22, 2006  4:16 PM
UPDATED: February 23, 2006  10:13 AM

Answer Wiki

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

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.

Discuss This Question: 3  Replies

 
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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Riccardi
    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 pointsBadges:
    report
  • bmarshall
    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 pointsBadges:
    report
  • 281056
    if you put of this form: UserID Password
    0 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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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

Following