FTP from AS400 to PC

Posted on 2009-04-29
Medium Priority
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

Expert Comment

ID: 24260869

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

ID: 24261894
I cannot Install any Software  as per my Shop.

Assisted Solution

rward earned 200 total points
ID: 24262585
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.

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 33

Accepted Solution

shalomc earned 900 total points
ID: 24268291
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 27

Expert Comment

ID: 24275059
> 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

ID: 24278683
Thank you , I will get back to you this evening.


Author Comment

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

Assisted Solution

tliotta earned 900 total points
ID: 24282626

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.


Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows 7 does not have the best desktop search built in. This is something Windows 7 users have struggled with. You type something in, and your search results don’t always match what you are looking for, or it doesn’t actually work at all. There ar…
The article covers five tools all IT professionals should know about, as they up productivity by a great deal!
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Suggested Courses

850 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