FTP from AS400 to PC

Posted on 2009-04-29
Last Modified: 2013-12-06
I have to FTP few Files from as400 to PC and make some changes in that file in PC then up load to AS400,
How can I do this using basic FTP ?
I do not have the IBM client access.  Basicaly I have to use the ftp from command line.

Please tell me which one is the best  login to as400 & ftp to PC or from PC ftp to AS400.

Thanks - Oramcle
Question by:Oramcle
    LVL 7

    Expert Comment


    Set a FileZilla FTP server on you PC. Easy and simple setup..

    Connect from AS400 to FTP on PC, put the files into the PC... work on the files.

    Connect from AS400 to FTP on PC, get the files in the AS400


    Author Comment

    I cannot Install any Software  as per my Shop.
    LVL 4

    Assisted Solution

    If FTP is running on the iSeries you can use the built-in command line FTP client in Windows to connect to and GET the files from the iSeries.  Once you've made the changes, you may be able to PUT them back on the iSeries.

    You will probably need to convert the iSeries file into a CSV before GETing it off the iSeries box.  You can use the CPYTOIMPF command to generate a CSV in the IFS and the CPYFRMIMPF to update an iSeries table from the CSV.  You may be able to do this without using FTP if you have iSeries Netserver configured and running.  If you do, you can use the QNTC file system to place the CSV file on a windows server share.

    creates a CSV file on the windows server MYWINSRVR in the share named MYSHARE

    copies the updated CSV back to the iSeries file QORDHDR

    If you have to use FTP you would change the above commands to save the CSV to a folder in the IFS (ie.  /tmp) , then FTP the file from the IFS folder to your PC and back up.

    LVL 32

    Accepted Solution

    using QNTC requires that the local user and password on both AS400 and Windows server are identical. I find this a limiting factor.

    your AS400 server probably has a FTP service running, and the following PC FTP script extracts the data from DB2 and gets it to the PC

    execute in on the PC with command
    ftp -s:scriptfile.txt as400server

    xxxxxxx is your password
    QGPL/QORDHDR id the table you want to extract.

    quote site namefmt 1
    get /transfers/QORDHDR.CSV

    Open in new window

    LVL 26

    Expert Comment

    > using QNTC requires that the local user and password on both AS400 and Windows server are identical. I find this a limiting factor.

    True as a general principle, but system facilities are available to minimize the impact.

    A designated local user can be created on the Windows NT system. A designated user profile of same name and password can be created on the AS/400. In both cases, capabilities should be minimized of course; e.g., the AS/400 profile should have INLMNU(*SIGNOFF), no 'special authorities', etc.

    Then, when access is needed to that /QNTC resource, the Get Profile Handle (QSYGETPH) and Set Profile (QWTSETP) APIs can be used to switch current user to the designated profile. After the /QNTC work is done, Set Profile (QWTSETP) and Release Profile Handle (QSYRLSPH) APIs would be used to return to the appropriate current user. A "before" and an "after" proc would be reasonable to make switching to and from the needed profile.

    Other facilities may be better suited for different environments.


    Author Comment

    Thank you , I will get back to you this evening.


    Author Comment

    My Problem is i need to FTP from IFS to My PC,
    Cmd> FTP server
    do i have to any namefmt ?
    LVL 26

    Assisted Solution


    The NAMEFMT subcommand is used when you want to reference objects with a different naming format. Your AS/400 supports two name formats -- one for IFS naming (*PATH is NAMEFMT 1) and one for the traditional library naming (*LIB is NAMEFMT 0). The FTP server has three general ways that it uses to determine which naming format you want.

    First, you can send a NAMEFMT subcommand to specifiy your naming format explicitly. Since most PCs run Windows and the Windows FTP client doesn't know what the NAMEFMT subcommand means, the subcommand needs to be sent to the AS/400 FTP server. That's usually done by:

     > quote site namefmt 1

    That tells the server to use the IFS PATH naming format.

    Second, the AS/400 FTP server can be configured to use either *LIB or *PATH naming as its default. You use the Change FTP Attributes command:

     ==>  chgftpa  namefmt( *PATH )

    That tells the server to start every session as NAMEFMT 1 by default. The CHGFTPA command can be prompted with <F4> on the AS/400 to see the attributes that can be changed. And using <F1> can show you [help] text for any part of the command.

    Third, the AS/400 FTP server can make a decision based on what FTP subcommands you send. The very first subcommand that contains the name of an object is used to choose which format is appropriate.

    So, if the first thing you send is:

     >  cd /home/myhomedir

    ...the FTP server assumes that you want NAMEFMT 1. The rest of the session will be handled in NAMEFMT 1 unless you explicitly send a NAMEFMT subcommand to change to NAMEFMT 0.

    You need to send a NAMEFMT subcommand only if you want the name format that is different from the default and if you don't send some command (e.g., CD) that the server can use to make a decision.

    By sending NAMEFMT, you avoid relying on possible misunderstandings between you and the server.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Just about everyone has an old PC laying around.  Ask anyone in the IT industry, whether they are a professional or play in it as a hobby.  From outdated Desktops to cheap "throwaway" laptops, they are all around and not as hard to "fix up" as you m…
    I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now