Re: EBCDIC packed fields conversion

From: Måns Rullgård (mru_at_inprovide.com)
Date: 12/14/04


Date: Tue, 14 Dec 2004 00:17:47 +0100


"Dan Mercer" <dmercer@mn.rr.com> writes:

> "Måns Rullgård" <mru@inprovide.com> wrote in message news:yw1xwtvlj1f4.fsf@ford.inprovide.com...
> : "eric" <eric.roelofs@ubs.com> writes:
> :
> : > Hi. I have a need to generate an EBCDIC file on a Unix platform to FTP
> : > up to a mainframe. The file will then be read by COBOL modules on the
> : > mainframe. I have a specific file layout that I need to create which
> : > contains some packed fields. My question is how to create an EBCDIC
> : > based file on a Unix platform that contains packed data fields? Is
> : > this even possible? Thank you.
> :
> : Does "dd conv=ebcdic" do anything useful?
>
> No - it translates EBCDIC to ascii

My "man dd" tell me this:

        Conversions:
              ascii Convert EBCDIC to ASCII.
              ebcdic Convert ASCII to EBCDIC.
              ibm Convert ASCII to alternate EBCDIC.

(and a bunch of others)

> (and there are two ways to do that and some IBM EBCDIC symbols have
> NO matching representation in ASCII)

I'm not doubting that.

> and it converts fixed width fields to linefeed terminated lines,
> stripping trailing spaces.

That would be conv=unblock.

> It will trash packed fields.

Would you care to elaborate a little on the structure of the input
data, and the required structure of the output file? I'm pretty sure
there's a simple way to get the job done, as long as the output is
representable as a sequence of bytes.

-- 
Måns Rullgård
mru@inprovide.com