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:
or01 CLASS-OUT. 05 CCNUM-OUT PIC X(14). 05 CCDESC-OUT PIC X(40). 05 CL-OUT PIC X(14). 05 CLDESC-OUT PIC X(38).
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.01 MASTER-OUT REDEFINES HEADER-RECORD. 05 CC-NUMBER PIC 9(04). 05 MTD-UNITS PIC S9(07). 05 MTD-DOLLARS PIC S9(09). 05 INV-ON-HAND PIC S9(07).
I would really appreciate any suggetions on how to start.
Thanks!!!
Update: This is on an HP-UX with Perl 5.6.1Sweetblood
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: COBOL to ascii conversions
by VSarkiss (Monsignor) on Dec 03, 2004 at 21:07 UTC | |
Re: COBOL to ascii conversions
by fglock (Vicar) on Dec 03, 2004 at 21:27 UTC |
Back to
Seekers of Perl Wisdom