read COBOL index file with perl

G

Gabkin

I need to parse a COBOL index file using a perl script.
I don't know _that_ much about COBOL but it seems the index file is
written in some kind of binary format, its not ASCII, thats for sure!

Has this been done before?
Is there an existing library I can use for this?

failing that...
Does anyone know how COBOL writes its index files and how I could go
about parsing them with perl?
Or is there a simple way to read and parse binary style data?
 
J

John Bokma

Gabkin said:
I need to parse a COBOL index file using a perl script.
I don't know _that_ much about COBOL but it seems the index file is
written in some kind of binary format, its not ASCII, thats for sure!

Has this been done before?
Is there an existing library I can use for this?

failing that...
Does anyone know how COBOL writes its index files and how I could go
about parsing them with perl?
Or is there a simple way to read and parse binary style data?

perldoc -f read
perldoc -f unpack
perldoc -f binmode

<http://search.cpan.org/search?mode=all&query=COBOL> gave:
<http://search.cpan.org/~grommel/Convert-IBM390-0.18/IBM390.pm>
"A COBOL EXAMPLE"

<http://www.google.com/search?q=COBOL+"index+file"+specification>
<http://myfileformats.com/search.php?cat_id=170&cat_name=Miscellaneous&start=1>
Ryan McFarland (RM-COBOL) Index File layout

Might be helpful.
 
A

Anno Siegel

Gabkin said:
I need to parse a COBOL index file using a perl script.
I don't know _that_ much about COBOL but it seems the index file is
written in some kind of binary format, its not ASCII, thats for sure!

Has this been done before?
Is there an existing library I can use for this?

failing that...
Does anyone know how COBOL writes its index files and how I could go
about parsing them with perl?
Or is there a simple way to read and parse binary style data?

There is (see "perldoc -f pack" and "perldoc -f unpack"), but you got
to know the style. I have no idea what an index file is in COBOL,
but it's quite possible that the format depends on the particular
system and compiler.

Anno
 
T

Tad McClellan

Gabkin said:
I need to parse a COBOL index file using a perl script.
I don't know _that_ much about COBOL but it seems the index file is
written in some kind of binary format, its not ASCII, thats for sure!

Has this been done before?


Google Groups is your friend:

http://groups.google.com/groups?as_q=Cobol&as_ugroup=comp.lang.perl.misc

Is there an existing library I can use for this?


CPAN is your friend:

http://search.cpan.org/search?query=cobol&mode=all

Does anyone know how COBOL writes its index files


Usenet is your friend:

comp.lang.cobol

Which leads you to your new friend, Google Groups, again:

http://groups.google.com/groups?as_epq=index file&as_ugroup=comp.lang.cobol

and how I could go
about parsing them with perl?


perldoc -f pack
perldoc -f unpack
perldoc -f seek
perldoc -f read

Or is there a simple way to read and parse binary style data?
^^^^^^

The Perl FAQ is your friend:

perldoc -q binary

How do I handle binary data correctly?
How do I randomly update a binary file?
 
G

Gabkin

Google Groups is your friend:

http://groups.google.com/groups?as_q=Cobol&as_ugroup=comp.lang.perl.misc



CPAN is your friend:

http://search.cpan.org/search?query=cobol&mode=all


Usenet is your friend:

comp.lang.cobol

Which leads you to your new friend, Google Groups, again:

http://groups.google.com/groups?as_epq=index file&as_ugroup=comp.lang.cobol


^^^^^^

The Perl FAQ is your friend:

perldoc -q binary

How do I handle binary data correctly?
How do I randomly update a binary file?

Wow, whatalot of friends I've got!


Thanks, will check out those sources.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top