Conversion from EBCDIC to Ascii OR unicode

I have a file in my Unix ( SOLARIS ) with EBCDIC format...I want this file to read in ASCII OR unicode...Is it possible with UNIX to convert this file on ASCII OR UNICODE format from EBCDIC format?

I was searching through web and found only conversion table :frowning:

Request Rejected

Below is sample data of my file.

������������������������@@@@������������������������������@���@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

EBCDIC is a codeset; not a format.
Two common utilities to convert from EBCDIC to ASCII or UTF-8 are

iconv -f fromcode -t tocode EBCDIC_input_file

(you can use iconv -l to get a list of fromcode and tocode values for your system), and

dd if=EBCDIC_input_file of=ASCII_output_file conv=ascii
1 Like

Thanks much for your reply...

I tried below command it gives me ERROR:

Command:

iconv -f EBCDIC  -t UTF-8  so_tran05.dat_bkp

ERROR:

iconv: conversion from EBCDIC unsupported
iconv: try 'iconv -l' to get the list of supported encodings

I copied output of iconv -l :

ANSI_X3.4-1968 ANSI_X3.4-1986 ASCII CP367 IBM367 ISO-IR-6 ISO646-US ISO_646.IRV:1991 US US-ASCII CSASCII
UTF-8
ISO-10646-UCS-2 UCS-2 CSUNICODE
UCS-2BE UNICODE-1-1 UNICODEBIG CSUNICODE11
UCS-2LE UNICODELITTLE
ISO-10646-UCS-4 UCS-4 CSUCS4
UCS-4BE
UCS-4LE
UTF-16
UTF-16BE
UTF-16LE
UTF-32
UTF-32BE
UTF-32LE
UNICODE-1-1-UTF-7 UTF-7 CSUNICODE11UTF7
UCS-2-INTERNAL
UCS-2-SWAPPED
UCS-4-INTERNAL
UCS-4-SWAPPED
C99
JAVA
CP819 IBM819 ISO-8859-1 ISO-IR-100 ISO8859-1 ISO_8859-1 ISO_8859-1:1987 L1 LATIN1 CSISOLATIN1
ISO-8859-2 ISO-IR-101 ISO8859-2 ISO_8859-2 ISO_8859-2:1987 L2 LATIN2 CSISOLATIN2
ISO-8859-3 ISO-IR-109 ISO8859-3 ISO_8859-3 ISO_8859-3:1988 L3 LATIN3 CSISOLATIN3
ISO-8859-4 ISO-IR-110 ISO8859-4 ISO_8859-4 ISO_8859-4:1988 L4 LATIN4 CSISOLATIN4
CYRILLIC ISO-8859-5 ISO-IR-144 ISO8859-5 ISO_8859-5 ISO_8859-5:1988 CSISOLATINCYRILLIC
ARABIC ASMO-708 ECMA-114 ISO-8859-6 ISO-IR-127 ISO8859-6 ISO_8859-6 ISO_8859-6:1987 CSISOLATINARABIC
ECMA-118 ELOT_928 GREEK GREEK8 ISO-8859-7 ISO-IR-126 ISO8859-7 ISO_8859-7 ISO_8859-7:1987 ISO_8859-7:2003 CSISOLATINGREEK
HEBREW ISO-8859-8 ISO-IR-138 ISO8859-8 ISO_8859-8 ISO_8859-8:1988 CSISOLATINHEBREW
ISO-8859-9 ISO-IR-148 ISO8859-9 ISO_8859-9 ISO_8859-9:1989 L5 LATIN5 CSISOLATIN5
ISO-8859-10 ISO-IR-157 ISO8859-10 ISO_8859-10 ISO_8859-10:1992 L6 LATIN6 CSISOLATIN6
ISO-8859-11 ISO8859-11 ISO_8859-11
ISO-8859-13 ISO-IR-179 ISO8859-13 ISO_8859-13 L7 LATIN7
ISO-8859-14 ISO-CELTIC ISO-IR-199 ISO8859-14 ISO_8859-14 ISO_8859-14:1998 L8 LATIN8
ISO-8859-15 ISO-IR-203 ISO8859-15 ISO_8859-15 ISO_8859-15:1998 LATIN-9
ISO-8859-16 ISO-IR-226 ISO8859-16 ISO_8859-16 ISO_8859-16:2001 L10 LATIN10
KOI8-R CSKOI8R
KOI8-U
KOI8-RU
CP1250 MS-EE WINDOWS-1250
CP1251 MS-CYRL WINDOWS-1251
CP1252 MS-ANSI WINDOWS-1252
CP1253 MS-GREEK WINDOWS-1253
CP1254 MS-TURK WINDOWS-1254
CP1255 MS-HEBR WINDOWS-1255
CP1256 MS-ARAB WINDOWS-1256
CP1257 WINBALTRIM WINDOWS-1257
CP1258 WINDOWS-1258
850 CP850 IBM850 CSPC850MULTILINGUAL
862 CP862 IBM862 CSPC862LATINHEBREW
866 CP866 IBM866 CSIBM866
MAC MACINTOSH MACROMAN CSMACINTOSH
MACCENTRALEUROPE
MACICELAND
MACCROATIAN
MACROMANIA
MACCYRILLIC
MACUKRAINE
MACGREEK
MACTURKISH
MACHEBREW
MACARABIC
MACTHAI
HP-ROMAN8 R8 ROMAN8 CSHPROMAN8
NEXTSTEP
ARMSCII-8
GEORGIAN-ACADEMY
GEORGIAN-PS
KOI8-T
CP154 CYRILLIC-ASIAN PT154 PTCP154 CSPTCP154
MULELAO-1
CP1133 IBM-CP1133
ISO-IR-166 TIS-620 TIS620 TIS620-0 TIS620.2529-1 TIS620.2533-0 TIS620.2533-1
CP874 WINDOWS-874
VISCII VISCII1.1-1 CSVISCII
TCVN TCVN-5712 TCVN5712-1 TCVN5712-1:1993
ISO-IR-14 ISO646-JP JIS_C6220-1969-RO JP CSISO14JISC6220RO
JISX0201-1976 JIS_X0201 X0201 CSHALFWIDTHKATAKANA
ISO-IR-87 JIS0208 JIS_C6226-1983 JIS_X0208 JIS_X0208-1983 JIS_X0208-1990 X0208 CSISO87JISX0208
ISO-IR-159 JIS_X0212 JIS_X0212-1990 JIS_X0212.1990-0 X0212 CSISO159JISX02121990
CN GB_1988-80 ISO-IR-57 ISO646-CN CSISO57GB1988
CHINESE GB_2312-80 ISO-IR-58 CSISO58GB231280
CN-GB-ISOIR165 ISO-IR-165
ISO-IR-149 KOREAN KSC_5601 KS_C_5601-1987 KS_C_5601-1989 CSKSC56011987
EUC-JP EUCJP EXTENDED_UNIX_CODE_PACKED_FORMAT_FOR_JAPANESE CSEUCPKDFMTJAPANESE
MS_KANJI SHIFT-JIS SHIFT_JIS SJIS CSSHIFTJIS
CP932
ISO-2022-JP CSISO2022JP
ISO-2022-JP-1
ISO-2022-JP-2 CSISO2022JP2
CN-GB EUC-CN EUCCN GB2312 CSGB2312
GBK
CP936 MS936 WINDOWS-936
GB18030
ISO-2022-CN CSISO2022CN
ISO-2022-CN-EXT
HZ HZ-GB-2312
EUC-TW EUCTW CSEUCTW
BIG-5 BIG-FIVE BIG5 BIGFIVE CN-BIG5 CSBIG5
CP950
BIG5-HKSCS:1999
BIG5-HKSCS:2001
BIG5-HKSCS BIG5-HKSCS:2004 BIG5HKSCS
EUC-KR EUCKR CSEUCKR
CP949 UHC
CP1361 JOHAB
ISO-2022-KR CSISO2022KR

Is this actually EBCDIC? Or is it something like packed decimal?

1 Like

And what happens when you try the other code I suggested:

dd if=so_tran05.dat_bkp conv=ascii
1 Like

Sorry for the late reply....Thanks much for all your help

I tried dd comand as well and it did convert the data but it seems it did not converted correctly.

My basic requirement is....I am converting abinitio graph to informatica.... The source in INFA is EBCDIC which I need to convert to ASCII in order to use it in INFA, any help is highly appreciated ...below is DDL from abinition:

ebcdic record
  string(10) btn;
  string(3) btn_cust_cd;
  string(1) btn_sort_cd;
  string(4) btn_east_sfx;
  string(1) btn_admin_st_cd;
  date("YYYYMMDD") acct_estab_dt;
  string(1) locn_id;
  decimal(10) acct_id;
end;

OK. So your data is NOT EBCDIC; it is some kind of "abinition" or "abinitio graph" (whatever they are) record format. Presumably the string fields were correctly converted by the dd command, but the date and decimal fields were not. I have no idea how "abinition" or "abinitio" encode data stored in date or decimal fields, but from your very poor description of what dd did, we have to assume that they are not encoded as EBCDIC strings.

Without a clear description of the format of your input file, it will be difficult to convert your data to ASCII. Furthermore, shell scripts are not generally well suited to performing conversions on arbitrary binary data intermixed with character data.

1 Like

Below is the output from dd

16499373+1 records in
16499373+1 records out
8447679135 bytes (8.4 GB) copied, 286.2 seconds, 29.5 MB/s

Why I was saying it is ebcdic as it was there in DML of the source in abinition ( abinitio is a ETL tool like INFORMATICA )...DML is basically the definition of source with what format and filed etc....

---------- Post updated at 06:01 AM ---------- Previous update was at 05:46 AM ----------

Below is the output from dd:
16499373+1 records in
16499373+1 records out
8447679135 bytes (8.4 GB) copied, 286.2 seconds, 29.5 MB/s

Why I was asking it is EBCDID as it is mentioned in the DML of ABINITIO source (DML in my last reply)... ABINITIO is a ETL tool as INFORMATICA and source DML describes the source functionalists like number of columns, format etc...

---------- Post updated at 06:02 AM ---------- Previous update was at 06:01 AM ----------

Below is the output from dd

16499373+1 records in
16499373+1 records out
8447679135 bytes (8.4 GB) copied, 286.2 seconds, 29.5 MB/s

Why I was saying it is ebcdic as it was there in DML of the source in abinition ( abinitio is a ETL tool like INFORMATICA )...DML is basically the definition of source with what format and filed etc....

---------- Post updated at 06:01 AM ---------- Previous update was at 05:46 AM ----------

Below is the output from dd:
16499373+1 records in
16499373+1 records out
8447679135 bytes (8.4 GB) copied, 286.2 seconds, 29.5 MB/s

Why I was asking it is EBCDID as it is mentioned in the DML of ABINITIO source (DML in my last reply)... ABINITIO is a ETL tool as INFORMATICA and source DML describes the source functionalists like number of columns, format etc...

What keeps you from posting (a meaningful portion of) your data file so we can have a look? Obscure classified data if need be.

Actually the data is in format which is different so it looks strange...I just coiped few lines as below:

md-co6:crtgs000:curtfin>more /opt/stage01/CuRT/consumer/DATA_source/so_tran05.dat
������������������������@@@@������������������������������@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@�������������@@@@@@�������������@@@@@�����������������������@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@�@���������������@@@@@@P<�����������������������@@@@@@@@@@@��������������������@@��������@@@@
@@@@@@@@@@@@@@@��������@@@@@@@@@@@@@@@@@@@@@@@���������@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@���@@@@@@@�������@@@������@@@@@@@@
@@@@@@@@@@@@��@@@@@@@@@@@@@@@@��@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@����������@@@@@@@@����@�������@�@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@�@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@���@����@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@�@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@������@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@���@@@@@@@@������@@@@�����
a��a��@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@��������@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@����������������@@@@@@@@����������������@@@@@@@@@@@@@@@@@�������������@@@@@@�������������@@@@@�����������������������@��������
�����@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@�������
��������@@@@@@P<L�����������������������@@@@@@@���������������������@@�@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@���@@����������@@@@����������@@@@����������@@@@@@@@@
@@@���������������@@���F�Fy^L@@@@@�������@@@������@@���@@@���@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@����������������@@@@@@@@@@@@@

Sorry - didn't mean "post" but "attach" which is offered when you "Go Advanced".

I tried to attach the file but it failed....

Moderator comments were removed during original forum migration.

I understand that my explanation was not that correct for you, but there is something which I can not write in words.. :frowning:

i am working on this from INFORMATICA level, n hope I will get success....

Will keep this forum updated... thanks much for help....

Experts, need your help. I have a file which is in ebcdic binary (cp 1047). I tried dd if=so_tran05.dat_bkp conv=ascii. This command converts everything except packed decimal amount fields and date/timestamp fields. What is the workaround?

output looks like

21211       001332        80473WA0680002                                    \201\250*^L53073   20131004        20140101  201401019010200C35406^L

expected output

21211          01332        80473WA0680002                                         214.95       0.0053073        20131004 20140101        201401019010200C35406NN2015-02-12 07:54:09

When starting a new question, please start your own thread instead of starting a second discussion in an existing thread!

However, in this case, you are just rephrasing the same issue that started this thread. Your question has already been answered by the comments given to joshilalit2004 who started this thread.

Please attach the file.

If you cannot attach it, please explain why. Use a screenshot if necessary.