COBOL to ascii conversionsby sweetblood (Parson)
|on Dec 03, 2004 at 21:03 UTC||Need Help??|
sweetblood has asked for the
wisdom of the Perl Monks concerning the following question:
I have a bunch of data files along with COBOL copybooks. I need to convert these COBOL data files to ascii. I suspect I'll need to use pack/unpack to get at these data, but I don't have the foggiest notion where to begin. I do have perlpacktut and Pack/Unpack Tutorial, I have not read them as yet but will start as soon as I finish this post.
The copybooks I have look like this:
I also have a COBOL reference that tells me that 'PIC X(14).' tells me that the data field is a 14-byte alpha-numeric field and that PIC S9(07) is a 7-byte signed integer. I'm just not sure how to get Perl to pass this as ascii.
I would really appreciate any suggetions on how to start.
Thanks!!!Update: This is on an HP-UX with Perl 5.6.1