Re: hex to ebcdic



Thanks a lot.
I have Convert::EBCDIC, but didn't quite figure out how to do it.

Actually the file that I am ftping from the mainframe has packed
numeric (comp.) as well as these display fields. So thats why I do a
binary mode ftp.

Then I use "unpack "H*", $buf" and all the display fields show up as
hex representation of EBCDIC.
So I will use Gunner's suggestion to convert them.. There maybe other
ways like the convertibm390 module as well I guess..

Thanks very much once again..

use Convert::EBCDIC 'ebcdic2ascii';
$hex = 'f1f2d7d9f0';
( $ebcdic = $hex ) =~ s/(..)/chr(hex $1)/eg;
$ascii = ebcdic2ascii( $ebcdic );

--
Gunnar Hjalmarsson
Email:http://www.gunnar.cc/cgi-bin/contact.pl


.



Relevant Pages

  • Re: Identifting sign in COMP data
    ... On Jun 28, 10:14 pm, Louis Krupp ... Can anyone tell me how to recognize whether the COMP ... And which mainframe is it? ... floating point value into an exponent and a mantissa. ...
    (comp.lang.cobol)
  • Re: FTP has extra CR
    ... A vendor has been FTPing a file from their mainframe to our Unix ...
    (bit.listserv.ibm-main)
  • Re: Win32, FTP, line ends
    ... If the mainframe file ... Windows' built-in ftp command handles the line ends correctly. ... I just tried ftping to our mainframe without problems, ...
    (comp.lang.perl.misc)
  • FTP has extra CR
    ... A vendor has been FTPing a file from their mainframe to our Unix ... For IBM-MAIN subscribe / signoff / archive access instructions, ... send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO ...
    (bit.listserv.ibm-main)
  • Re: Identifting sign in COMP data
    ... then simply reverse the MOVE statements of the mainframe ... they are just never produced by COBOL - but COBOL can handle them. ... Can anyone tell me how to recognize whether the COMP ... For instance in COMP-3 data, if the last nibble is 'C' then we say it ...
    (comp.lang.cobol)