• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Healing Failed Windows-i5/OS FTP Transfers

    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

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    ARCAD Software

    Embrace VS Code for IBM i Development

    The IBM i development landscape is evolving with modern tools that enhance efficiency and collaboration. Ready to make the move to VS Code for IBM i?

    Join us for this webinar where we’ll showcase how VS Code can serve as a powerful editor for native IBM i code and explore the essential extensions that make it possible.

    In this session, you’ll discover:

    • How ARCAD’s integration with VS Code provides deep metadata insights, allowing developers to assess the impact of their changes upfront.
    • The role of Git in enabling seamless collaboration between developers using tools like SEU, RDi, and VS Code.
    • Powerful extensions for code quality, security, impact analysis, smart build, and automated RPG conversion to Free Form.
    • How non-IBM i developers can now contribute to IBM i projects without prior knowledge of its specifics, while ensuring full control over their changes.

    The future of IBM i development is here. Let ARCAD be your guide!

    Watch Now

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    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

    InfoPrint Launches a Product for Automated Document Factories IBM’s Q3 in Servers, Redux: The i and p Platforms Do OK

    Leave a Reply Cancel reply

Volume 8, Number 36 -- October 22, 2008
THIS ISSUE SPONSORED BY:

Help/Systems
WorksRight Software
Aldon

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

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • Liam Allan Shares What’s Coming Next With Code For IBM i
  • From Stable To Scalable: Visual LANSA 16 Powers IBM i Growth – Launching July 8
  • VS Code Will Be The Heart Of The Modern IBM i Platform
  • The AS/400: A 37-Year-Old Dog That Loves To Learn New Tricks
  • IBM i PTF Guide, Volume 27, Number 25
  • Meet The Next Gen Of IBMers Helping To Build IBM i
  • Looks Like IBM Is Building A Linux-Like PASE For IBM i After All
  • Will Independent IBM i Clouds Survive PowerVS?
  • Now, IBM Is Jacking Up Hardware Maintenance Prices
  • IBM i PTF Guide, Volume 27, Number 24

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle