EBCDIC-ASCII Conversation

  • Thread starter Reinhard Burgmann
  • Start date
R

Reinhard Burgmann

Hello,

I have to convert a EBCDIC-File into an ASCII-Code in perl. Unfortunately
part's of the files are in packed format I have to do this in perl. I think
a solution with two arrays is possible but maybe somebody has a better idea?

Thanks in advance

Reinhard
 
J

James Willmore

A

Alan J. Flavell

I have to convert a EBCDIC-File into an ASCII-Code in perl. Unfortunately
part's of the files are in packed format I have to do this in perl.

Clarification, please. Are you saying that these data records contain
"packed decimal" fields? Then a mere character code conversion from
EBCDIC to ASCII is not going to help. You need to know the format of
your records (i.e which ranges contain packed-decimal), and unpack
those into signed decimal format before continuing.

Presumably Perl can do that with an appropriate unpack() template, but
it's not something I've had reason to try (I was fresh out of IBM
mainframes around the time that I first met Perl, and anyway, in
scientific work we hardly ever had to deal with packed-decimal data in
practice).
 
L

len v

Alan J. Flavell said:
Clarification, please. Are you saying that these data records contain
"packed decimal" fields? Then a mere character code conversion from
EBCDIC to ASCII is not going to help. You need to know the format of
your records (i.e which ranges contain packed-decimal), and unpack
those into signed decimal format before continuing.

Presumably Perl can do that with an appropriate unpack() template, but
it's not something I've had reason to try (I was fresh out of IBM
mainframes around the time that I first met Perl, and anyway, in
scientific work we hardly ever had to deal with packed-decimal data in
practice).


Try Convert::IBM390.pm using the umpackeb() subroutine

http://search.cpan.org/~grommel/Convert-IBM390-0.15/IBM390.pm

Len
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,787
Messages
2,569,630
Members
45,338
Latest member
41Pearline46

Latest Threads

Top