cobol to ascii translation
- From: roch77@xxxxxxxxx
- Date: Fri, 29 Jun 2007 08:30:10 -0700
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,
.
- Follow-Ups:
- Re: cobol to ascii translation
- From: Doug Miller
- Re: cobol to ascii translation
- Prev by Date: Re: MF Runtime Error 077
- Next by Date: Re: cobol to ascii translation
- Previous by thread: Identifting sign in COMP data
- Next by thread: Re: cobol to ascii translation
- Index(es):
Relevant Pages
|