COBCH0853S System error - evaluation stack mismatch

Hi,

I am getting

'COBCH0853S System error - evaluation stack mismatch ... -> in the line 'EVALUATE HV-POS' 

using the VC5 Bytecode Compiler when compiling

EVALUATE HV-POS
       WHEN 02 MOVE 'something ' TO H-TEXT
       ADD 1 TO ZZ-02
       WHEN 67 MOVE 'something else ' TO H-TEXT
       MOVE 'J' TO KEZ-AUSGABE
      WHEN 68 MOVE 'something else x ' TO H-TEXT
      MOVE 'J' TO KEZ-AUSGABE
      WHEN ANY MOVE ' ' TO H-TEXT
END-EVALUATE

Reducing the nestings, e.g.

EVALUATE HV-POS
       WHEN 02 MOVE 'something ' TO H-TEXT
       ADD 1 TO ZZ-02
*       WHEN 67 MOVE 'something else ' TO H-TEXT
*       MOVE 'J' TO KEZ-AUSGABE
      WHEN 68 MOVE 'something else x ' TO H-TEXT
      MOVE 'J' TO KEZ-AUSGABE
      WHEN ANY MOVE ' ' TO H-TEXT
END-EVALUATE

or 

EVALUATE HV-POS
       WHEN 02 MOVE 'something ' TO H-TEXT
       ADD 1 TO ZZ-02
       WHEN 67 MOVE 'something else ' TO H-TEXT
       MOVE 'J' TO KEZ-AUSGABE
      WHEN 68 MOVE 'something else x ' TO H-TEXT
      MOVE 'J' TO KEZ-AUSGABE
*      WHEN ANY MOVE ' ' TO H-TEXT
END-EVALUATE

ist works.

It also compiles with a former VC compiler (2.3 or 4) or the 'native compiler'

Is there any Directive where I can limit the nestings ?!

Thanks and greetings,

Herbert

 

Parents
  • Verified Answer

    Is it when any or when other?
    i think when other
    Why do you want to Limit nestings?
    What is you Problem?
  • EVALUATE HV-POS
    *     WHEN 02 MOVE 'something ' TO H-TEXT
    *     ADD 1 TO ZZ-02
    WHEN 67 MOVE 'something else ' TO H-TEXT
    MOVE 'J' TO KEZ-AUSGABE
    *      WHEN 68 MOVE 'something else x ' TO H-TEXT    
    *      MOVE 'J' TO KEZ-AUSGABE
    WHEN ANY MOVE ' ' TO H-TEXT
    END-EVALUATE

    -> also compiles ...

  • Which Patch Update do you have applied?

    I tested with V5.0 PU5 compiling to JVM COBOL and it compiles fine.
    I had to create my own data items because you did not share your definitions. Could you please do so?

    The following works for me:

    working-storage section. 01 hv-pos pic 9(4) value 1. 01 h-text pic x(100) value spaces. 01 zz-02 pic 9(3) value zeroes. 01 KEZ-AUSGABE pic x(20) value spaces. procedure division. EVALUATE HV-POS WHEN 02 MOVE 'something ' TO H-TEXT ADD 1 TO ZZ-02 WHEN 67 MOVE 'something else ' TO H-TEXT MOVE 'J' TO KEZ-AUSGABE WHEN 68 MOVE 'something else x ' TO H-TEXT MOVE 'J' TO KEZ-AUSGABE WHEN ANY MOVE ' ' TO H-TEXT END-EVALUATE
  • HV-POS PIC S9(4) COMP-5.

    H-TEXT PIC X(18) VALUE SPACE.

    We are using

    Visual COBOL for Eclipse 5.0

    Version: 5.0.00256
    Serial Number: 600000799575,600000799575
    Architecture: 64 bit

  • Unfortunately, although this does compile with the latest version of Visual COBOL, the resulting code does not run, giving a JNI verification error.

    This seems to be because of the use of WHEN ANY for the default condition instead of the more usual WHEN OTHER.  If you switch to using WHEN OTHER, you should find that this works correctly.

    WHEN ANY is acceptable syntax (though it's more commonly used when the EVALUATE has multiple selection subjects), so this is definitely a bug that needs fixing.

     

Reply
  • Unfortunately, although this does compile with the latest version of Visual COBOL, the resulting code does not run, giving a JNI verification error.

    This seems to be because of the use of WHEN ANY for the default condition instead of the more usual WHEN OTHER.  If you switch to using WHEN OTHER, you should find that this works correctly.

    WHEN ANY is acceptable syntax (though it's more commonly used when the EVALUATE has multiple selection subjects), so this is definitely a bug that needs fixing.

     

Children
No Data