I'm trying to parse my first codebook, which I've had to manually extract from a PDF. I took the raw codebook text and ran it through a couple of sed scripts to produce what looks to me like a valid codebook.
Running that codebook through the parser throws a parse exception on the first field. The stack trace is:
class net.sf.cb2xml.sablecc.node.TDataName, state : 0, text :
java.lang.RuntimeException: fatal parse error
=== buffer dump start ===
FIELD-MAST
=== buffer dump end ===
at net.sf.cb2java.copybook.CopybookParser.parse(CopybookParser.java:72)
at net.sf.cb2java.copybook.CopybookParser.parse(CopybookParser.java:39)
at com.grid.core.dataload.server.datasource.cobol.CobolReader.doSomething(CobolReader.java:36)
at com.grid.core.dataload.server.datasource.cobol.CobolReader.main(CobolReader.java:24)
Caused by: net.sf.cb2xml.sablecc.parser.ParserException: expecting: number88, number not88
at net.sf.cb2xml.sablecc.parser.Parser.parse(Parser.java:410)
at net.sf.cb2java.copybook.CopybookParser.parse(CopybookParser.java:67)
… 3 more
The codebook is several pages long, but the start of it is:
01 FIELD-MAST.
02 OIL-CODES.
03 TYPE-REC PIC 9.
03 DIST PIC XXX.
03 FIELD PIC 9(8).
03 OPR PIC 9(6).
03 LEASE PIC 9(5).
03 LSE-FILLER PIC 99.
03 OFFSHORE PIC 9.
02 FIELD-DATA.
03 F-NAME PIC X(32).
03 COUNTY PIC 9(18).
03 COUNTIES REDEFINES COUNTY OCCURS 6 TIMES PIC 9(3).
03 DISC-DATE PIC 9(8).
03 D-DATE REDEFINES DISC-DATE.
I'd appreciate any help understanding what's going on.
thanks,
Nick
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2013-01-28
By codebook I mean copybook
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying to parse my first codebook, which I've had to manually extract from a PDF. I took the raw codebook text and ran it through a couple of sed scripts to produce what looks to me like a valid codebook.
Running that codebook through the parser throws a parse exception on the first field. The stack trace is:
class net.sf.cb2xml.sablecc.node.TDataName, state : 0, text :
java.lang.RuntimeException: fatal parse error
=== buffer dump start ===
FIELD-MAST
=== buffer dump end ===
at net.sf.cb2java.copybook.CopybookParser.parse(CopybookParser.java:72)
at net.sf.cb2java.copybook.CopybookParser.parse(CopybookParser.java:39)
at com.grid.core.dataload.server.datasource.cobol.CobolReader.doSomething(CobolReader.java:36)
at com.grid.core.dataload.server.datasource.cobol.CobolReader.main(CobolReader.java:24)
Caused by: net.sf.cb2xml.sablecc.parser.ParserException: expecting: number88, number not88
at net.sf.cb2xml.sablecc.parser.Parser.parse(Parser.java:410)
at net.sf.cb2java.copybook.CopybookParser.parse(CopybookParser.java:67)
… 3 more
The codebook is several pages long, but the start of it is:
01 FIELD-MAST.
02 OIL-CODES.
03 TYPE-REC PIC 9.
03 DIST PIC XXX.
03 FIELD PIC 9(8).
03 OPR PIC 9(6).
03 LEASE PIC 9(5).
03 LSE-FILLER PIC 99.
03 OFFSHORE PIC 9.
02 FIELD-DATA.
03 F-NAME PIC X(32).
03 COUNTY PIC 9(18).
03 COUNTIES REDEFINES COUNTY OCCURS 6 TIMES PIC 9(3).
03 DISC-DATE PIC 9(8).
03 D-DATE REDEFINES DISC-DATE.
I'd appreciate any help understanding what's going on.
thanks,
Nick
By codebook I mean copybook