Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Feb 2001 08:43:16 +1100
From:      Tony Landells <ahl@austclear.com.au>
To:        "Fee, Doug" <doug.fee@unisys.com>
Cc:        "'freebsd-questions@freebsd.org'" <freebsd-questions@FreeBSD.ORG>
Subject:   Re: FTP to Mainframe Question 
Message-ID:  <200102202143.IAA03472@tungsten.austclear.com.au>
In-Reply-To: Message from "Fee, Doug" <doug.fee@unisys.com>  of "Tue, 20 Feb 2001 14:10:46 MDT." <ABBC508F9A30D3119E7200105A1770FBFAE418@us-fft-exch-1.frf.unisys.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Doug,

Let me make sure I understand what you're doing first...

The file you're trying to transfer is basically a text file (as in
it has newlines at the end of each line) with all the lines the same
length.

You're (presumably) generating the file on FreeBSD, and you're
transferring it to a mainframe that uses EBCDIC, but when it gets
there it still has the (converted) newlines which is stuffing up
the mainframe.

In theory, if you use ASCII transfer mode in FTP it should do
the end-of-line conversion for you (including throwing it away
completely if you're transferring to a record-oriented OS), but
I don't know how well that would work if you've already converted
the file to EBCDIC on the UNIX system.  But IF you've been using
binary mode, try ASCII and see what happens.

The other option is to strip the newlines before you send your
file.  You can do this quite effectively in dd using the "conv=block"
option combined with the "cbs" option.  Supposing that all your
records are 60 characters (61 including the newline), then the
command is "dd if=infile of=outfile cbs=60 conv=block,ebcdic".

Of course, I can't really test this, so you'll have to try it
out, but it's worked for me in other circumstances.

Cheers,
Tony
-- 
Tony Landells					<ahl@austclear.com.au>
Senior Network Engineer				Ph:  +61 3 9677 9319
Australian Clearing Services Pty Ltd		Fax: +61 3 9677 9355
Level 4, Rialto North Tower
525 Collins Street
Melbourne VIC 3000
Australia



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200102202143.IAA03472>