Re: cobol to ascii translation
- From: spambait@xxxxxxxxxx (Doug Miller)
- Date: Fri, 29 Jun 2007 15:47:33 GMT
In article <1183131010.025069.104020@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, roch77@xxxxxxxxx wrote:
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..
Some indication of what you *are* getting would be helpful... as well as some
indication of how you're going about it -- not to mention what platform you're
working on.
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?
With an ebcdic-to-ascii conversion. Without knowing what you're doing now, and
how it's not working, it's pretty hard to advise you how to fix it.
--
Regards,
Doug Miller (alphageek at milmac dot com)
It's time to throw all their damned tea in the harbor again.
.
- Follow-Ups:
- Re: cobol to ascii translation
- From: Michael Mattias
- Re: cobol to ascii translation
- References:
- cobol to ascii translation
- From: roch77
- cobol to ascii translation
- Prev by Date: cobol to ascii translation
- Next by Date: Re: cobol to ascii translation
- Previous by thread: cobol to ascii translation
- Next by thread: Re: cobol to ascii translation
- Index(es):
Relevant Pages
|