Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CONVERT ASCII TEXT TO EBCDIC?

583 views
Skip to first unread message

r_r...@vcc7.vcc.bc.ca

unread,
Sep 29, 1994, 7:17:40 PM9/29/94
to
cir...@asmusa.org wrote:
: Has anyone had the need to convert a ascii text file
: to ebcdic? I was wondering if there is a command that will allow
: me to convert my ascii file to edcdic and also write that format
: to tape.

Sure, the dd command will convert to and from EBCDIC and ASCII.

cir...@asmusa.org

unread,
Sep 29, 1994, 10:16:07 AM9/29/94
to


Hello Aix World,


Has anyone had the need to convert a ascii text file
to ebcdic? I was wondering if there is a command that will allow
me to convert my ascii file to edcdic and also write that format
to tape.

Thanks in advance...


Clarence Irons

email : cir...@asmusa.org

Joerg Passenberg

unread,
Sep 30, 1994, 5:06:34 PM9/30/94
to

There is also a tool called recode avaible (gnu), which can convert
between a lot of formats:

ANSI_X3.4-1968 ansix341968 ansix341986 ascii cp367 ibm367 iso646irv1991
iso646ui
ASMO_449 arabic7 asmo449 iso9036 isoir89
BS_4730 bs4730 gb iso646gb isoir4 uk
BS_viewdata bsviewdata isoir47
CSA_Z243.4-1985-1 ca csa71 csaz243419851 iso646ca isoir121
CSA_Z243.4-1985-2 csa72 csaz243419852 iso646ca2 isoir122
CSA_Z243.4-1985-gr csaz24341985gr isoir123
CSN_369103 csn369103 isoir139
DEC-MCS dec decmcs
DIN_66003 de din66003 iso646de isoir21
DS_2089 dk ds2089 iso646dk
EBCDIC-AT-DE ebcdicatde
EBCDIC-AT-DE-A ebcdicatdea
EBCDIC-CA-FR ebcdiccafr
EBCDIC-DK-NO ebcdicdkno
EBCDIC-DK-NO-A ebcdicdknoa
EBCDIC-ES ebcdices
EBCDIC-ES-A ebcdicesa
EBCDIC-ES-S ebcdicess
EBCDIC-FI-SE ebcdicfise
EBCDIC-FI-SE-A ebcdicfisea
EBCDIC-FR ebcdicfr
EBCDIC-IT ebcdicit
EBCDIC-PT ebcdicpt
EBCDIC-UK ebcdicuk
EBCDIC-US ebcdicus
ECMA-cyrillic ecmacyrillic isoir111
ES es iso646es isoir17
ES2 es2 iso646es2 isoir85
GB_1988-80 cn gb198880 iso646cn isoir57
GOST_19768-74 gost1976874 isoir153 stsev35888
IBM037 cp037 ebcdiccpca ebcdiccpnl ebcdiccpus ebcdiccpwt ibm037
IBM038 cp038 ebcdicint ibm038
IBM1026 cp1026 ibm1026
IBM273 cp273 ibm273
IBM274 cp274 ebcdicbe ibm274
IBM275 cp275 ebcdicbr ibm275
IBM277 ebcdiccpdk ebcdiccpno ibm277
IBM278 cp278 ebcdiccpfi ebcdiccpse ibm278
IBM280 cp280 ebcdiccpit ibm280
IBM281 cp281 ebcdicjpe ibm281
IBM284 cp284 ebcdiccpes ibm284
IBM285 cp285 ebcdiccpgb ibm285
IBM290 cp290 ebcdicjpkana ibm290
IBM297 cp297 ebcdiccpfr ibm297
IBM420 cp420 ebcdiccpar1 ibm420
IBM423 cp423 ebcdiccpgr ibm423
IBM424 cp424 ebcdiccphe ibm424
IBM437 437 cp437 ibm437
IBM500 cp500 ebcdiccpbe ebcdiccpch ibm500
IBM850 850 cp850 ibm850
IBM851 851 cp851 ibm851
IBM852 852 cp852 ibm852
IBM855 855 cp855 ibm855
IBM857 857 cp857 ibm857
IBM860 860 cp860 ibm860
IBM861 861 cp861 cpis ibm861
IBM862 862 cp862 ibm862
IBM863 863 cp863 ibm863
IBM864 cp864 ibm864
IBM865 865 cp865 ibm865
IBM868 cp868 cpar ibm868
IBM869 869 cp869 cpgr ibm869
IBM870 cp870 ebcdiccproece ebcdiccpyu ibm870
IBM871 cp871 ebcdiccpis ibm871
IBM880 cp880 ebcdiccyrillic ibm880
IBM891 cp891 ibm891
IBM903 cp903 ibm903
IBM904 904 cp904 ibm904
IBM905 cp905 ebcdiccptr ibm905
IBM918 cp918 ebcdiccpar2 ibm918
IEC_P27-1 iecp271 isoir143
INIS inis isoir49
INIS-8 inis8 isoir50
INIS-cyrillic iniscyrillic isoir51
INVARIANT invariant
ISO_10367-box iso10367box isoir155
ISO_2033-1983 e13b iso20331983 isoir98
ISO_5427 iso5427 isoir37
ISO_5427:1981 iso54271981 isoir54
ISO_5428:1980 iso54281980 isoir55
ISO_646.basic:1983 iso646basic1983 ref
ISO_646.irv:1983 irv iso646irv1983 isoir2
ISO_6937-2-25 iso6937225 isoir152
ISO_8859-1:1987 cp819 ibm819 iso88591 iso885911987 isoir100 l1 lat1 latin1
ISO_8859-2:1987 iso88592 iso885921987 isoir101 l2 latin2
ISO_8859-3:1988 iso88593 iso885931988 isoir109 l3 latin3
ISO_8859-4:1988 iso88594 iso885941988 isoir110 l4 latin4
ISO_8859-5:1988 cyrillic iso88595 iso885951988 isoir144
ISO_8859-6:1987 arabic asmo708 ecma114 iso88596 iso885961987 isoir127
ISO_8859-7:1987 ecma118 elot928 greek greek8 iso88597 iso885971987 isoir126
ISO_8859-8:1988 hebrew iso88598 iso885981988 isoir138
ISO_8859-9:1989 iso88599 iso885991989 isoir148 l5 latin5
ISO_8859-supp iso8859supp isoir154 latin125
IT iso646it isoir15 it
JIS_C6220-1969-jp isoir13 jisc62201969 jisc62201969jp katakana x02017
JIS_C6220-1969-ro iso646jp isoir14 jisc62201969ro jp
JIS_C6229-1984-a jisc62291984a jpocra
JIS_C6229-1984-b iso646jpocrb jisc62291984b jpocrb
JIS_C6229-1984-b-add isoir93 jisc62291984badd jpocrbadd
JIS_C6229-1984-hand isoir94 jisc62291984hand jpocrhand
JIS_C6229-1984-hand-add isoir95 jisc62291984handadd jpocrhandadd
JIS_C6229-1984-kana isoir96 jisc62291984kana
JIS_X0201 jisx0201 x0201
JUS_I.B1.002 iso646yu isoir141 js jusib1002 yu
JUS_I.B1.003-mac isoir147 jusib1003mac macedonian
JUS_I.B1.003-serb isoir146 jusib1003serb serbian
KSC5636 iso646kr ksc5636
Latin-greek-1 isoir27 latingreek1
MSZ_7795.3 hu iso646hu isoir86 msz77953
NATS-DANO isoir91 natsdano
NATS-DANO-ADD isoir92 natsdanoadd
NATS-SEFI isoir81 natssefi
NATS-SEFI-ADD isoir82 natssefiadd
NC_NC00-10:81 cuba iso646cu isoir151 ncnc001081
NF_Z_62-010 fr iso646fr isoir69 nfz62010
NF_Z_62-010_(1973) iso646fr1 isoir25 nfz620101973
NS_4551-1 iso646no isoir60 no ns45511
NS_4551-2 iso646no2 isoir61 no2 ns45512
NeXTSTEP nextstep
PT iso646pt isoir16 pt
PT2 iso646pt2 isoir84 pt2
RFC 1345 rfc1345
SEN_850200_B fi iso646fi iso646se isoir10 se sen850200b
SEN_850200_C iso646se2 isoir11 se2 sen850200c
T.61-7bit isoir102 t617bit
applemac applemac
ascii-bs asciibs
atarist atarist
bangbang bangbang
cdcnos cdcnos
dk-us dkus
ebcdic ebcdic
ebcdic-ccc ebcdicccc
ebcdic-ibm ebcdicibm
flat flat
greek-ccitt greekccitt isoir150
greek7 greek7 isoir88
greek7-old greek7old isoir18
hp-roman8 hproman8 r8 roman8
ibmpc ibmpc
iconqnx iconqnx
latex latex ltex
latin-greek isoir19 latingreek
latin-lap isoir158 lap latinlap
latin6 isoir157 l6 latin6
macintosh mac macintosh
texte texte txte
us-dk usdk

by, Joerg

---
Joerg Passenberg eMail: iss...@cips1.gm.fh-koeln.de (NeXTMail)
Alte Hofstr.31 iss...@advs2.gm.fh-koeln.de
51709 Marienheide Phone: +49 2264 6991
Germany Fax: +49 2264 28223 (by arrangement)

Jan Mandel

unread,
Oct 1, 1994, 9:52:16 AM10/1/94
to
Dan Prener (pre...@watson.ibm.com) wrote:
: In article <1994Sep29.1...@tigger.jvnc.net> cir...@asmusa.org writes:

: > Has anyone had the need to convert a ascii text file

: > to ebcdic? I was wondering if there is a command that will allow
: > me to convert my ascii file to edcdic and also write that format
: > to tape.

: Look at the conv option of dd.

Mean rumor from the time I worked on 360/370/3090 has it that the actual
EBCDIC tables for various mainframes are IBM trade secret.
The man page for dd shows relevant conv= options

ascii Converts EBCDIC to ASCII.
ebcdic Converts ASCII to standard EBCDIC.
ibm Converts ASCII to an IBM version of EBCDIC.

Note the indefinite article ... Good luck.

--
Jan Mandel, Center for Computational Math, University of Colorado at Denver
jma...@colorado.edu

Dan Prener

unread,
Oct 1, 1994, 12:15:53 AM10/1/94
to

> Has anyone had the need to convert a ascii text file
> to ebcdic? I was wondering if there is a command that will allow
> me to convert my ascii file to edcdic and also write that format
> to tape.

Look at the conv option of dd.
--
Dan Prener (pre...@watson.ibm.com)

Mr MacTex

unread,
Oct 1, 1994, 11:35:02 AM10/1/94
to
In article <1994Sep29.1...@tigger.jvnc.net>, cir...@asmusa.org
writes:

Try using the "dd" command. You can convert ascii to ebcdic and vice
versa.

Dan Prener

unread,
Oct 2, 1994, 12:46:40 AM10/2/94
to

> Dan Prener (pre...@watson.ibm.com) wrote:
> : In article <1994Sep29.1...@tigger.jvnc.net> cir...@asmusa.org writes:
>
> : > Has anyone had the need to convert a ascii text file
> : > to ebcdic? I was wondering if there is a command that will allow
> : > me to convert my ascii file to edcdic and also write that format
> : > to tape.
>
> : Look at the conv option of dd.
>
> Mean rumor from the time I worked on 360/370/3090 has it that the actual
> EBCDIC tables for various mainframes are IBM trade secret.
> The man page for dd shows relevant conv= options
>
> ascii Converts EBCDIC to ASCII.
> ebcdic Converts ASCII to standard EBCDIC.
> ibm Converts ASCII to an IBM version of EBCDIC.
>
> Note the indefinite article ... Good luck.

I could post the conversion tables (the ones available to me are in
octal), but they don't really make interesting reading for everyone.

At the risk of stating the obvious, anyone who wants to know what
they are can apply the various conversion options of dd to a file
containing the 256 one-byte values.
--
Dan Prener (pre...@watson.ibm.com)

Jan Mandel

unread,
Oct 2, 1994, 11:37:02 AM10/2/94
to

Well that the tables are secret was of course a joke.
What is not a joke is that there is not a single EBCDIC code but
rather a number of versions accumulated over the ages. To which one will
the poor user translate? Which one will his target mainframe understand?

[Few years back, when we used BITNET instead of Internet, some mails
forwarded thru certain mainframes got garbled in interesting ways,
for example, once I think all } (right curly bracket) got replaced by bell, ^G.
This was blamed on different ASCII/EBCDIC tables on the route... Made sending
TeX files quite difficult.. around 1988 I think]

Bill Manry - IBM SBU

unread,
Oct 3, 1994, 7:32:08 PM10/3/94
to
Jan Mandel (jma...@carbon.denver.colorado.edu) wrote:
[...]

> What is not a joke is that there is not a single EBCDIC code but
> rather a number of versions accumulated over the ages. To which one will
> the poor user translate? Which one will his target mainframe understand?

For that matter, which ASCII does his client use? The existence
of multiple encodings is not unique to EBCDIC.

EBCDIC codepage 37 prevails in the USA while various national
codepages are used in Europe etc. In recent standardization projects
IBM has proposed codepage 500 as a "default" EBCDIC. It differs
from codepage 37 only in the points assigned to a few glyphs.

/b
----------
Bill Manry
Oracle Corp. / Mainframe & Integration Technologies / BMa...@us.oracle.com
#include <disclaimer.usual>

Michael G. Phillips

unread,
Oct 3, 1994, 10:49:07 PM10/3/94
to
Bill Manry - IBM SBU (bma...@upsizeme.us.oracle.com) wrote:

: Jan Mandel (jma...@carbon.denver.colorado.edu) wrote:
: [...]
: > What is not a joke is that there is not a single EBCDIC code but
: > rather a number of versions accumulated over the ages. To which one will
: > the poor user translate? Which one will his target mainframe understand?

: For that matter, which ASCII does his client use? The existence
: of multiple encodings is not unique to EBCDIC.

Having watched this thread (and others like it before) I am
really amused at how much "effort" has been extended to worring
about "character" set translations when the real problem is most
likely, *many* packed-decimal and/or binary fields combined with
an abundance of record redefinition so common in just about
*every* 360/370/etc host based system. I should know, I've had
to port them, support them, and even create some myself (%-).
But then some of us are just too old to have been "born to unix"
and have even paid bills with COBOL knowledge...

Back to the thread: The real key is to build a parser that
can read your file definitions and generate conversion code.
Of course, some hand tweaking will be required to provide
all of the "expert" knowledge to determine which redefines
gets used when. As for which ASCII & which EBCDIC, hell just
make that a run time option, sooner or later you'll find the
right set for *that* tape... now what about *this* tape?

-michael
--
--------------------------------------------------------------------
Michael G. Phillips mg...@crl.com mg...@atldbs.dbsoftware.com
(404)239-2766 "Just because it worked doesn't mean it works." -- me

Bill Manry - Oracle Corporation

unread,
Oct 4, 1994, 3:00:20 AM10/4/94
to
Michael G. Phillips (mg...@crl.com) wrote:
[...]

> Having watched this thread (and others like it before) I am
> really amused at how much "effort" has been extended to worring
> about "character" set translations when the real problem is most
> likely, *many* packed-decimal and/or binary fields combined with
> an abundance of record redefinition so common in just about
> *every* 360/370/etc host based system. I should know, I've had
> to port them, support them, and even create some myself (%-).
> But then some of us are just too old to have been "born to unix"
> and have even paid bills with COBOL knowledge...

The man speaks verily indeed. We have a couple of products that do
this (e.g. unsnarl mainframe record structures into data that ASCII
client-ish systems like) and it's not fun.

But...the original posting specifically concerned translating text
from ASCII to EBCDIC, hence the digression into an area of interest
to most international users at least. I doubt that the poster wants
or intends to construct complete mixed-format mainframe records on
the ASCII side.

;-)

((Has anyone had the need to convert a ascii text file
((to ebcdic? I was wondering if there is a command that will allow
((me to convert my ascii file to edcdic and also write that format
((to tape.

Hans Henrik Eriksen

unread,
Oct 4, 1994, 7:55:04 AM10/4/94
to
> Has anyone had the need to convert a ascii text file
> to ebcdic? I was wondering if there is a command that will allow
> me to convert my ascii file to edcdic and also write that format
> to tape.
>
> Clarence Irons

dd if=inputfile conv=ebcdic of=/dev/rmt0

or whatever you your tape device is

Hans Henrik
--
Hans Henrik Eriksen !Office: Norsk Hydro a.s, VKD187
Open Systems Consultants a.s! Tlf.: (+47) 22 73 96 60
St. Olavgt. 24, N-0166 Oslo ! Fax: (+47) 22 73 97 19
Tlf.: (+47) 22 20 40 50 ! Beep: (+47) 966 27546

Jack Gostl

unread,
Oct 6, 1994, 6:42:35 AM10/6/94
to
Michael G. Phillips (mg...@crl.com) wrote:
: Bill Manry - IBM SBU (bma...@upsizeme.us.oracle.com) wrote:
: : Jan Mandel (jma...@carbon.denver.colorado.edu) wrote:
: : [...]
: : > What is not a joke is that there is not a single EBCDIC code but
: : > rather a number of versions accumulated over the ages. To which one will
: : > the poor user translate? Which one will his target mainframe understand?

: : For that matter, which ASCII does his client use? The existence
: : of multiple encodings is not unique to EBCDIC.

: Having watched this thread (and others like it before) I am
: really amused at how much "effort" has been extended to worring
: about "character" set translations when the real problem is most
: likely, *many* packed-decimal and/or binary fields combined with
: an abundance of record redefinition so common in just about
: *every* 360/370/etc host based system. I should know, I've had
: to port them, support them, and even create some myself (%-).
: But then some of us are just too old to have been "born to unix"
: and have even paid bills with COBOL knowledge...

Usually, but not always. Can't remember which, but either { or }
translates differently on Burroughs, oops, Unisys systems than on IBM
systems. Haven't heard of any other differences.

--
ARGOS Computer Systems, Inc. 110 West 32nd Street New York, NY 10001

Edward T Spire

unread,
Oct 7, 1994, 4:20:27 PM10/7/94
to
Michael G. Phillips (mg...@crl.com) wrote:
: Having watched this thread (and others like it before) I am

: really amused at how much "effort" has been extended to worring
: about "character" set translations when the real problem is most
: likely, *many* packed-decimal and/or binary fields combined with
: an abundance of record redefinition so common in just about
: *every* 360/370/etc host based system.

: Back to the thread: The real key is to build a parser that

: can read your file definitions and generate conversion code.
: Of course, some hand tweaking will be required to provide
: all of the "expert" knowledge to determine which redefines
: gets used when.

Exactly. Packed decimal, zoned decimal, and binary fields are common.
You really want a program that will read a COBOL FD include file and
figure out how to convert the date. Also, standard tapes labels i
(including multi-volume support) need to be handled.

A filter that reads control fields from stdin and messages to stderr,
a tape device or such as real data input, and stdout as the real data
output sounds right to me. I'd be willing to write this product
if I could work with a real customer on the project, rather than
working in a vacuum.
--

========== The only fool bigger than one who is always right ===========
=============== is one who must argue with that person =================
Ed Spire e...@wrkgrp.com

Olaf Ehbrecht

unread,
Oct 7, 1994, 3:43:04 PM10/7/94
to
Hans Henrik Eriksen (eri...@hda.hydro.com) wrote:

>In article <1994Sep29.1...@tigger.jvnc.net> cir...@asmusa.org writes:
>>
>> Has anyone had the need to convert a ascii text file
>> to ebcdic? I was wondering if there is a command that will allow
>> me to convert my ascii file to edcdic and also write that format
>> to tape.
>>
>> Clarence Irons
>
> dd if=inputfile conv=ebcdic of=/dev/rmt0
>
> or whatever you your tape device is
>
> Hans Henrik

for conversion only: axeb (ebxa for ebcdic to ascii)

but, this programs only works for standard ascii-codes (0-127) !

If you have international (french,schwedish,german,...) ascii text, with
ascii-codes above 127, try 'iconv' !

Olaf.
--
Greetings from another Okami Newsreader user.

0 new messages