opensourcecobol / Open-COBOL-ESQL

Open Cobol ESQL (ocesql) is an open-source Embedded SQL pre-compiler and run-time library designed for COBOL applications which access an open-source database.
https://www.osscons.jp/osscobol/
GNU Lesser General Public License v3.0
50 stars 24 forks source link

Parser brings an error on Ascending Clause #17

Open hansobermair opened 5 years ago

hansobermair commented 5 years ago

Hi,

on this statement the parser reports an error:

   01 T98-TAB.
     05 T98-ROWID-LAST        PIC  9(009) COMP-5 VALUE ZERO.
     05 T98-ROWID-NEW         PIC  9(009) COMP-5 VALUE ZERO.
     05 T98-TAB-CACHE  OCCURS 100
        DEPENDING ON Z-T98-EINTRAEGE
        ASCENDING KEY IS T98-ROWID
        INDEXED BY I-TAB.

I can only precompile the source, when I put this statements in an extry Cobol-Library.

Any suggestions?

Kind regards

Hans

n-isaka commented 4 years ago

Hi, Hans.

Sorry for the late reply...

It is syntex error in ocesql precompir at word IS in ASCENDING KEY IS T98-ROWID.

By removing IS, can precompile this source.

   01 T98-TAB.
     05 T98-ROWID-LAST        PIC  9(009) COMP-5 VALUE ZERO.
     05 T98-ROWID-NEW         PIC  9(009) COMP-5 VALUE ZERO.
     05 T98-TAB-CACHE  OCCURS 100
        DEPENDING ON Z-T98-EINTRAEGE
        ASCENDING KEY T98-ROWID
        INDEXED BY I-TAB.

How about this?

GitMensch commented 4 years ago

The workaround is nice, but where would be the place to fix that in the ocesql source?

GitMensch commented 3 years ago

The main reason for this issue is found in #25.

GitMensch commented 1 year ago

@n-isaka wrote

It is syntex error in ocesql precompir at word IS in ASCENDING KEY IS T98-ROWID.

By removing IS, can precompile this source.

   01 T98-TAB.
     05 T98-ROWID-LAST        PIC  9(009) COMP-5 VALUE ZERO.
     05 T98-ROWID-NEW         PIC  9(009) COMP-5 VALUE ZERO.
     05 T98-TAB-CACHE  OCCURS 100
        DEPENDING ON Z-T98-EINTRAEGE
        ASCENDING KEY T98-ROWID
        INDEXED BY I-TAB.

Are you sure? The parser does not contain the KEY phrase at all (neither does it contain DEPENDING [ON] var or INDEXED [BY] var).

Adding those to the parser with a plain "ignore" as result would be useful. @yutaro-sakamoto What is your take on this?