Open-COBOL-ESQL icon indicating copy to clipboard operation
Open-COBOL-ESQL copied to clipboard

Parser brings an error on Ascending Clause

Open hansobermair opened this issue 6 years ago • 4 comments

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

hansobermair avatar Sep 27 '19 08:09 hansobermair

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?

n-isaka avatar Oct 28 '19 08:10 n-isaka

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

GitMensch avatar Jul 08 '20 07:07 GitMensch

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

GitMensch avatar Jul 19 '21 07:07 GitMensch

@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?

GitMensch avatar Jun 28 '23 07:06 GitMensch