fhg
Volume 8, Number 36 -- October 22, 2008

Healing Failed Windows-i5/OS FTP Transfers

Published: October 22, 2008

Hey, Joe:

I tried running the attached FTP script to automatically transfer AS/400 Integrated File System (AS/400 IFS) files to a Windows server, but I can't get it to work. I can run my transfer commands manually but not automatically. Can you tell me what I'm doing wrong?

--Dave


Thanks, Dave. I'll give it a shot. Here's the FTP script that you sent me.

OPEN system_name
USERNAME
PASSWORD
CD /ifs_directory_name
LCD C:\directory_name
MGET *.*
QUIT

Here's the Windows FTP command that you're using to run the script.

ftp -s:getfile.scr system_name

Once you run the command, you get the following FTP error:

> User (system_name:(none)):
< 501 User name not valid in USER subcommand.
< Login failed.

Here's what I think is happening.

In your Windows FTP statement, you added the name of the i5/OS system (system_name) that you're connecting to as the last parameter of that statement.

ftp -s:getfile.scr system_name

This initiates the connection with your AS/400, iSeries, or System i box. However, in your FTP script file, you also have this Connect to FTP Server on a Remote System subcommand (OPEN) listed.

OPEN system_name 

In your case, OPEN tells FTP to attempt a second connection to your system. However, because the connection is already open, the automated FTP transfer won't execute this command. Instead, the transfer tries to use the values in the OPEN subcommand as the user name and password to sign on to your system with (because it's the first line in your FTP script). At that point, your automated FTP connection fails because it can't sign on with that information.

To combat this problem and to test my theory, I changed your FTP statement and your FTP script to the values below.


Updated Windows FTP command:

ftp -s:test.scr -i system_name

Updated Windows FTP script:

USERNAME
PASSWORD
QUOTE SITE NA 1
CD /ifs_directory_name
LCD C:\directory_name
ASCII
MGET *.*
QUIT

After I made the changes, the automated transfer worked. Here's what I did and why it worked.

1. I eliminated the redundant OPEN command in the FTP script. This solved your user sign-on problem by allowing the script to use the correct USERNAME and PASSWORD values when signing on.

2. I added a Select File Naming Format (QUOTE SITE NA 1) subcommand to the script. The NA command tells i5/OS to accept IFS naming file formats during the transfer (format '1'). By default, the system uses naming format '0', which only allows FTP to use standard i5/OS library names in the CD and MGET commands. On your system, the transfer might work depending on what the default system value is for your FTP Initial Naming Format parameter. You can check the default value by prompting the Change FTP Attributes (CHGFTPA) command, as follows.

CHGFTPA

Look at the Initial name format (NAMEFMT) parameter. If it is set to *LIB, your default naming format value is '0'. If set to *PATH, the default naming format value is '1'. For more information on the Initial File Naming Format and other FTP configuration parameters, see this article on Configuring OS/400 FTP.

3. To allow the Copy Multiple Files subcommand (MGET) command to work, I added the –i parameter to the Windows FTP call statement, like this:

ftp -s:test.scr -i system_name

The -i tells FTP to ignore any interactive prompting during multiple transfers. This eliminates hang-ups caused when FTP prompts for a confirmation on each file transfer that is initiated through MGET. With –i, MGET transfers all its files without any user interaction. The need for this fix appeared after I solved the sign-on problem in point 1.

4. I added the Change File Type to ASCII FTP (ASCII) subcommand to tell FTP that it is transferring files to an ASCII system. The transfer may run without it, but I put it in for insurance.

Once I made these changes, the transfer started working normally.

HTH

--Joe


About Our Testing Environment

Configurations described in this article were tested on an i5 550 box running i5/OS V5R4. Many of the commands are also available in earlier versions of the operating system running on Power i, System i, iSeries or AS/400 machines. If a command is present in earlier versions of the i5/OS or OS/400 operating systems, you may notice variations in the pre-V5R4 copies of these commands. These differences may be due to command improvements that have occurred from release to release.




                     Post this story to del.icio.us
               Post this story to Digg
    Post this story to Slashdot


Sponsored By
ALDON


Modernize Don't Replace IBM i Applications.

Billions of lines of code have been written for crucial business operations
from finance to customer relations – all on the IBM i platform.

Find out how to modernize them with new graphical user interfaces,
high availability, web enablement and more by downloading
a free whitepaper from Aldon –
Modernizing IBM i Applications for Multi-platform development.

Download Here



Senior Technical Editor: Ted Holt
Technical Editor: Joe Hertvik
Contributing Technical Editors: Edwin Earley, Brian Kelly, Michael Sansoterra
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.

Sponsored Links

MKS:  FREE white paper: From WDSC to RDi. Making Software Change Easier with MKS Integrity for IBM i
Vibrant Technologies:  The leading source for IBM Power Systems and Upgrades
COMMON:  Join us at the annual 2009 conference, April 26 - 30, in Reno, Nevada


 

IT Jungle Store Top Book Picks

Easy Steps to Internet Programming for AS/400, iSeries, and System i: List Price, $49.95
Getting Started with PHP for i5/OS: List Price, $59.95
The System i RPG & RPG IV Tutorial and Lab Exercises: List Price, $59.95
The System i Pocket RPG & RPG IV Guide: List Price, $69.95
The iSeries Pocket Database Guide: List Price, $59.00
The iSeries Pocket Developers' Guide: List Price, $59.00
The iSeries Pocket SQL Guide: List Price, $59.00
The iSeries Pocket Query Guide: List Price, $49.00
The iSeries Pocket WebFacing Primer: List Price, $39.00
Migrating to WebSphere Express for iSeries: List Price, $49.00
iSeries Express Web Implementer's Guide: List Price, $59.00
Getting Started with WebSphere Development Studio for iSeries: List Price, $79.95
Getting Started With WebSphere Development Studio Client for iSeries: List Price, $89.00
Getting Started with WebSphere Express for iSeries: List Price, $49.00
WebFacing Application Design and Development Guide: List Price, $55.00
Can the AS/400 Survive IBM?: List Price, $49.00
The All-Everything Machine: List Price, $29.95
Chip Wars: List Price, $29.95


 
The Four Hundred
Some Servers Take a Dive in IBM's Third Quarter

Gartner, Forrester Cut 2009 IT Spending Growth Estimates

Infor CEO Preaches Business Darwinism, Prepares for Hyper Business Future

Mad Dog 21/21: Home Deep Owe

IBM Cuts Disk Prices, Rejiggers Memory and CPU Conversion Prices

The Linux Beacon
Why Blade Servers Still Don't Cut It, and How They Might

Intel Keeps Both Arms Swinging with Xeons, Jabs with Itanium

Microsoft Ponies Up Another $100 Million for Novell Linux

Mad Dog 21/21: Newtonian Economics

Two More Xeon-Based Galaxy Servers from Sun

Four Hundred Stuff
Is Java the AS/400's Final Lifeline?

AquaFold Adds DB2/400 Support to Database Tool

Infor ERP LX Adds Compliance and Language Features, SOA Enablement

Shield Gets Closer to Full HA with RAP 3.1

IT Chiefs Don't Care About Software Quality, Survey Says

Big Iron
For Some Customers, the Mainframe Is Green

Top Mainframe Stories From Around the Web

Chats, Webinars, Seminars, Shows, and Other Happenings

System i PTF Guide
October 18, 2008: Volume 10, Number 42

October 11, 2008: Volume 10, Number 41

October 4, 2008: Volume 10, Number 40

September 27, 2008: Volume 10, Number 39

September 20, 2008: Volume 10, Number 38

September 14, 2008: Volume 10, Number 37

The Windows Observer
Citrix Addresses Performance with XenApp 5

Server Buyers Shop Like It's 1999 in the Second Quarter

Intel Keeps Both Arms Swinging with Xeons, Jabs with Itanium

Mad Dog 21/21: Newtonian Economics

Microsoft Does Something About Those SQL Injection Attacks

The Unix Guardian
What the Heck Is the Midrange, Anyway?

Overseas and Notebook Sales Offset Printer Declines for HP in Q3

Two More Xeon-Based Galaxy Servers from Sun

Mad Dog 21/21: Newtonian Economics

Intel's Nehalems to Star at IDF, AMD Pitches Shanghai

Four Hundred Monitor
Four Hundred Monitor's
Full iSeries Events Calendar

THIS ISSUE SPONSORED BY:

Help/Systems
WorksRight Software
Aldon


Printer Friendly Version


TABLE OF CONTENTS
Visual Explain for Run SQL Scripts

SQL Quickly and Dirtily Extracts a Field from a CSV File

Healing Failed Windows-i5/OS FTP Transfers

Four Hundred Guru

BACK ISSUES

From the IT Jungle Forums
Data Queues vs. MQ Series: Performance

Removing blanks from a CL Variable

XML

SQL "Hidden" Field

Java Messages

MQ Help Desired





 
Subscription Information:
You can unsubscribe, change your email address, or sign up for any of IT Jungle's free e-newsletters through our Web site at http://www.itjungle.com/sub/subscribe.html.

Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement