170 pts.
 FTP a zipped file to a client in a batch job from AS/400
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?

Software/Hardware used:
ASKED: February 22, 2009  3:32 PM
UPDATED: February 24, 2009  12:37 AM

Answer Wiki:
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:ftpfolder/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.
Last Wiki Answer Submitted:  February 23, 2009  10:27 am  by  Gilly400   23,625 pts.
All Answer Wiki Contributors:  Gilly400   23,625 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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


 

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 pts.

 

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,625 pts.

 

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 pts.

 

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,625 pts.

 

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 pts.