FTP a zipped file to a client in a batch job from AS/400

170 pts.
Tags:
AS/400 FTP
FTP
FTP PUT statement
QDLS
I need to ftp a file to a client box from our as400. should I use FTP or FTPPUT? I have the client logon and password. My file is a zipped document coming from qdls/email with email being a folder. I have manually tried the ftpput. I get logged in and it accepts my password. the error from printout: > put qdls/email/EMAIL.ZIP d:ftpfolderemail.zip specified object name too long: email/EMAIL. then it logs me off my clp stmt looks like this: ftpput rmtsys(ftp.xxxx.com) user(xxxxx) pwrd(xxxxx) tofile(d:ftpfolderemail.zip) + library('qdls/email') file('EMAIL.ZIP') if I need to use ftp...how do I set up the rest of the commands?

Answer Wiki

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

Hi,

To be able to FTP from the QDLS you need to use the HFS (Hierarchical File System) naming format. In your FTP session you need to use the following command to switch to HFS naming :-

NAMEFMT 1

Then you can put from the QDLS :-

put /QDLS/EMAIL/EMAIL.ZIP d:\ftp\folder/email.zip

The FTPPUT command is not part of the OS as far as I know – we don’t have it on our system, so I can’t help you with that.

Regards,

Martin Gilbert.

Discuss This Question: 5  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
  • Brenger
    OK, if I use FTP don't I have to put user, password, and put in some kind of source stmt? like qcmdsrc. or do they go into the clp?
    170 pointsBadges:
    report
  • Gilly400
    Hi, Yes, you'll need to put the user and password in a file or source file that you can use as a "script" for the FTP session. You then use OVRDBF to override the input for the FTP command to your script file - something like this :- OVRDBF FILE(INPUT) TOFILE(Yourlib/Yourfile) MBR(Yourmember) OVRDBF FILE(OUTPUT) TOFILE(Yourlib/FTPLOG) MBR(Yourmember) FTP RMTSYS(Servername) DLTOVR *ALL This will read the FTP commands from Yourlib/Yourfile(Yourmember) and will create output for the command in Yourlib/FTPLOG(Yourmember) - what would normally be shown on the screen if you run the commands interactively. This isn't a marvellous way of handling security (the auditors don't take kindly to passwords being stored in files) - an alternative is to write a small program that builds the FTP script file for you and prompts for the userid and password - but then you still need manual intervention. Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • Brenger
    I can get logged in , then I get an error msg I'm surprised I got this far. Thanks for any help. *************** Beginning of data ************************************* Output redirected to a file. Input read from specified override file. Connecting to host ip-999-99-999-99.nframe.net at address 999.99.999.99 using port 21. 220 Gene6 FTP Server v3.10.0 (Build 2) ready... Enter login ID (ftbdc): 331 Password required for USERID. 230 User USERID logged in. UNIX Type: L8 Enter an FTP subcommand. > NAMEFMT 1 500 Unknown command. Client NAMEFMT is 1. Enter an FTP subcommand. > PUT /QDLS/EMAIL/EMAIL.ZIP D:FTPLEGIONEMAIL.ZIP 227 Entering Passive Mode (999,99,999,99,195,123) 550 Cannot STOR. Enter an FTP subcommand. > QUIT 221 Goodbye. my srce cmds: *************** Beginning of data ***************** USERID pwrd NAMEFMT 1 PUT /QDLS/EMAIL/EMAIL.ZIP D:FTPUSERIDEMAIL.ZIP QUIT
    170 pointsBadges:
    report
  • Gilly400
    Hi, That all looks OK to me apart from the "550 Cannot STOR." message. If I google for this it seems to be a problem with authority on the FTP server. Can you check what happens if you FTP from somewhere else, maybe from a PC? Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • Brenger
    FYI for any others out there thinking of this: PUT /QDLS/EMAIL/EMAIL.ZIP D:FTPUSERIDEMAIL.ZIP PUT /QDLS/EMAIL/EMAIL.ZIP instead of stmt 1, use stmt 2.
    170 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