Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Remove spaces at the end of the Trailer while doing FTP?

Status
Not open for further replies.

dearjay

Programmer
Dec 19, 2007
35
IN
Dear All,

I am trying to transfer variable record length file from mainframe to Unix Solaris server. As we know that the mainframe file data is in EBCDIC format and to transfer on UNIX in ASCII format.

As i have LERCL = 1000 (Variable block file), sometimes i have input data on the mainframe only upto 600 characters, so remaining 400 characters are nothing (not even spaces, high values, low values),So if i transfer such mainframe file from mainframe to UNIX solaris server by using FTP command, spaces are getting created after the file trailer, because of that i am facing major problem, Can anybody let me know any suggestion on this.

Please suggest !!!
Regards,
Nits
 
Have you tried switching to binary mode before the transfer?
ftp>bin

Burt
 
You could just remove the spaces once it's on the Solaris side...
Code:
sed 's/  *$//g' file.orig > file.nospaces
 
Yes, I tried using BIN. But it was giving problem. Actually my Client does not want to run any script on UNIX solaris. Thats the main problem for me.

Do you have any other trick?

Regards,
Nits
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top