cobol to ascii translation



Hi,
I have a cobol data file from a unisys A series mainframe.

2 types of fields :

pic 9 (xx) comp. <= many fields of this type varying lengths
pic X (15) . <= only one field

I am having a problem translating the pic X (display field).

I ftp'd file from mainframe as binary. Each record is 120 bytes.

pic X field starts at byte 25 and the length is 15 bytes.

I am using perl and unpack.

When I did this:

$string = unpack H240, $record
the comp. fields come out fine and the display field is spit out in
hex representation of EBCDIC which I can manually translate using a
lookup table.

ie: f3f4f2f4f1f9f8f7f8c3d4f0f0f0f1 = 342419878CM0001

But I want to automate this. I thought I was able to use an
ebcdic2ascii function for this and translate the pic X field before
being unpacked, but I am not getting the right answer..

Can someone help pls? I am a beginner with this translation stuff.

To summarize, how do I translate a display field when file is ftp'd as
binary?

thanks a lot,

.



Relevant Pages

  • Re: cobol to ascii translation
    ... I have a cobol data file from a unisys A series mainframe. ... pic 9 comp. ... ebcdic2ascii function for this and translate the pic X field before ...
    (comp.lang.cobol)
  • Re: cobol to ascii translation
    ... I have a cobol data file from a unisys A series mainframe. ... pic 9 comp. ... ebcdic2ascii function for this and translate the pic X field before ... how do I translate a display field when file is ftp'd as ...
    (comp.lang.cobol)
  • Re: Why does English have so few compound words?
    ... From their union is the family-line come ... COMP we call of-Æsir kinsfolk, ... Sometimes it doesn't really translate at all: ...
    (sci.lang)
  • Re: domain name from ip address??
    ... comp. ... "Longhorn" wrote in message ... >> I would like to translate some ip addresses of machines that appear to ...
    (microsoft.public.security.virus)