During our tutorial on FTP for the iSeries webcast, our iSeries expert, Chris Peters from Evergreen Interactive
received a lot of questions. However we still had FTP questions that we didn't have time for during the live session. We forwarded your FTP for the iSeries questions to Chris and here are his reponses.
Is FTP the most efficient method for transferring PC files to an iSeries SAVFILE on a frequent basis as part of backup scheme?
Peters: Yes, I'd say FTP is as efficient as any transfer software. The efficiency of the transfer is more a factor of the network speed and traffic load.
Is The FTP Reference Guide found in the IBM Books?
Peters: Several chapters in the OS/400 TCP/IP Configuration and Reference V4R4 (SC41-5420-03) are devoted to configuring and using FTP. Examples are also provided.
On the iSeries during the day we have several FTP jobs happening. Is it possible that a conflict will cause a failure and to prevent a conflict? Should we configure more FTP servers or what?
Peters: The FTP server jobs will pretty much take care of themselves. FTP will pre-start the number of server jobs you specify to minimize start-up time. Additional requests will just take longer to initiate.
Is there a way to run FTP in batch on the iSeries and have it notify a user of failure?
Peters: There have been several questions about this. You have to use the OVRDBF statements shown in this IBM example CL program:
PGM OVRDBF FILE(INPUT) TOFILE(ITSOLIB2/QCLSRC) MBR(FTPCMDS) OVRDBF FILE(OUTPUT) TOFILE(ITSOLIB2/QCLSRC) MBR(OUT) FTP RMTSYS(SYSxxx) ENDPGM
The BATCHFTP program overrides the INPUT parameter to the source physical file ITSOLIB1/QCLSRC MBR(FTPCMDS). The output is sent to MBR(OUT).
The output from the FTP transfer would look like this:
FTP Output Redirected to a File FTP Input from Overridden File Connecting to host name SYSxxx at address x.xxx.xx.xxx using port 21. 220-QTCP at SYSxxx.sysnam123.ibm.com. 220 Connection will close if idle more than 5 minutes. Enter login ID (itso): > ITSO ITSO 331 Enter password. 230 ITSO logged on. OS/400 is the remote operating system. The TCP/IP version is… 250 Now using naming format "0". 257 "QGPL" is current library. Enter an FTP subcommand. > CD ITSOLIB1 Enter an FTP subcommand. 250 Current library changed to ITSOLIB1. > SYSCMD CHGCURLIB ITSOLIB2 Enter an FTP subcommand. > GET QCLSRC.BATCHFTP QCLSRC.BATCHFTP (REPLACE 200 PORT subcommand request successful. 150 Retrieving member BATCHFTP in file QCLSRC in library ITSOLIB1. 250 File transfer completed successfully. 147 bytes transferred in 0.487 seconds. Transfer rate 0.302… Enter an FTP subcommand. > QUIT 221 QUIT subcommand received.
And, finally (quoting from the IBM manual): "It is a straightforward matter to write a program to process this file and display an error message on QSYSOPR if there are any error messages. FTP error messages have numbers that start with a 4 or 5."
Why does the AS/400 quit a session because it can't connect via an active "conversation"?
Peters: I'm not sure I know what you mean but I'm assuming your referring to the connection time-out that will take place when an FTP session is left idlying too long. You have about 5 minutes before an idle connection is disconnected. You can change the value in FTP configuration.
How do I use a port other than 21?
Peters: I can't find any access to change the control port for FTP on the iSeries/400 at least at release V4R5.
How do I control passive vs. active? What is the difference?
Peters: A passive connection is normally a connection that is accepted on the host. An active connection is a connection that is initiated from a client. The 400 will register an active connection when it starts an FTP session and will register a passive connection when it accepts an FTP connection. Within a given session, the client and server will alternate transmitting (active) or receiving (passive) modes.
Can I use FTP commands in a CL program?
Peters: You can't use FTP subcommands directly in a CL program. You have to store them in a source member and reference the member as in the above example.
Is the add-in for Excel available before V5R1?
Peters: Yes, it was available under V4.
Can you have FTP Prompt for a password instead of putting it into a script?
Peters: Not directly. You would have to write a program that would prompt for the password and then write it to the script file.
How can one set up iSeries FTP Server using non-default port 21 to serving client requests?
Peters: To my knowledge, one can't change the control program's port for incoming requests on the iSeries.
What about the security about FTP?
Peters: Access to the iSeries for FTP users is the same as for other users -- user ID and password. You can also allow anonymous access. For other security considerations you may create an FTP exit program to perform a variety of security screening or logging.
What are the benefits of using FTP over Client Access file transfer?
Peters: FTP is probably easier to use, you can transfer a save file, all platforms that support TCP/IP will support FTP so you can transfer to/from Unix, AIX, etc.
Can you run a PC command in FTP from the AS/400 like you can run a CL command?
Peters: No, you have to create a script file (as a source file member.) See the example above.
Do you have examples of how to build the input "file in a CL"?
Peters: CL is not capable of writing to a database file. You would have to write a HLL program.
Can you automate a DOS FTP?
Peters: Sure. You would use the syntax:
to run the FTP program in a automated fashion in a DOS session.
Can you elaborate on the new PartnerWorld requirement?
Peters: IBM has upped the rate for the iSeries developer lease offering from 1% to 1.75% of list price. But some ISVs think IBM's strategy is way off base and are concerned IBM could be pricing more and more people out of the market. Get more details at http://www.the400group.com/aiw/free/06-1702.html
Can you tell us how to get logs of FTP activity?
Peters: See the example above for iSeries as the client. If a PC is the client, you can use one of the many FTP utilities that allow you to log FTP activity.
Can you recommend a way to encrypt data sending through FTP?
Peters: None other than writing a program to encrypt the data and another to de-encrypt the data once it's been transferred.
What different methods are there in the market that can be used to upload files to/from Excel to AS/400 with ease of use?
Peters: You can use CA file transfer to load iSeries files directly to or from Excel. There are other utilities that also perform the same function. My company has such a product. See http://www.evergreeninteractive.com/ for details.
Please describe the best method of handling FTP errors that are received during file transfers.
Peters: See the example above.
With CA Express data transfer, why do you have to download the file from the 400 to the PC before you can upload?
Peters: Because CA file transfer has to know how the fields lay out on the 400, so a FDF (field description file) is created on the transfer to the PC, and then referred to on the transfer to the 400. If you have a FDF already, then you don't have to run the transfer to the PC.
Is there a way to have an interactive script such that would issue a CPF message for each line in the script indicating the success or failure of the line?
Peters: No. See the example above.
How do you convert ASCII numeric data to non-packed numeric fields on the AS/400? We want to convert ASCII minus signs to EBCDIC.
Peters: When we created the utility that transfers data, we had to perform the packed data and minus sign translation with a HLL program. Quite complicated, too.