Menu

Parser failing on codebook

Help
Anonymous
2013-01-25
2013-04-25
  • Anonymous

    Anonymous - 2013-01-25

    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

     
  • Anonymous

    Anonymous - 2013-01-28

    By codebook I mean copybook

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.