FTP from AS400 to PC adds extra characters

Posted on 2003-02-21
Medium Priority
Last Modified: 2008-02-01
When I ftp (in ASCII mode) a 256 byte file from the AS400 to a PC  I end up with a 258 byte file on the PC.  Using the "bin" command makes the file unreadable by the PC software that's trying to process it.  How can I get rid of the two extra characters?
Question by:robfromroswell
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Expert Comment

ID: 7997693
Hi robfromroswell,

OS400 and PC should be running the same name format when you transfer the file from one to the other.

On the PC side the Dos FTP command is

'Quote site namefmt 1'

on as400 u can just give

'namefmt 1' only.

I think this will solve your problem




Author Comment

ID: 8009703
I entered the namefmt command on the AS/400 side per your suggestion, but I am still getting a 258 byte file.  

Accepted Solution

robfromroswell earned 0 total points
ID: 8037002
I have figured out how to do this.   First, you have to copy the file to the IFS.  Then use the 'namefmt 1' command.  Her's a compete example:

To copy the file to the IFS:

CPY OBJ('qsys.lib/pccharge.lib/IN999999.file/credpcch.mbr')  TOOBJ(IN999999)
This copied file IN999999, member CREDPCCH, in library PCCHARGE to the IFS and created a stream file named IN999999.
Then to ftp the file to the PC, I used these commands:
locsite trim 0   This keeps the trailing blanks.

name 1   Changes the file naming format so that you can specify a path name.

lcd /   Changes the AS/400 default directory.

put  IN999999  IN999999

And I used the AS/400 command RMVLNK to delete IN999999 from the IFS.

LVL 33

Expert Comment

ID: 8993161
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:


Please leave any comments here within the next seven days.


EE Cleanup Volunteer

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is a fine trick which I've found useful many times, when you just don't want to accidentally run a batch script or the commands needs administrator rights.
Hey fellow admins! This time, I have a little fairy tale for you. As many tales do, it starts boring and then gets pretty gory. I hope you like it. TL;DR: It is about an important security matter, you should read it if you run or administer Windows …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

762 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