• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 486
  • Last Modified:

FTP from AS400 to PC adds extra characters

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?
0
robfromroswell
Asked:
robfromroswell
  • 2
1 Solution
 
SRohitCommented:
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

Regards

Rohit

0
 
robfromroswellAuthor Commented:
I entered the namefmt command on the AS/400 side per your suggestion, but I am still getting a 258 byte file.  
0
 
robfromroswellAuthor Commented:
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.

0
 
shalomcCTOCommented:
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:

PAQ/Refund

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

ShalomC
EE Cleanup Volunteer
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now