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.

     

  • Thanks.

    Although this compiles OK for me I do get an error when it is run if ANY is used instead of OTHER in this example.

    Either ANY or OTHER should be allowed as selection objects but they are not interchangeable as they mean different things.

    WHEN OTHER will be true if all the preceding conditions have been evaluated as false.
    WHEN ANY will always be evaluated as true.

    WHEN ANY is normally used when there are multiple selection objects and you really only wish to be evaluating one of them for a specific condition.

    Example:
          EVALUATE     XXX     ALSO     YYY
                   WHEN ANY         ALSO    1      *> XXX can contain any value but YYY must be = 1
                          perform …
                    WHEN 2               ALSO ANY  *> YYY can contain any value but XXX must be = 2
                          perform...
                     WHEN OTHER   *> This will be true only if the previous 2 conditions are evaluated as false.
                          perform ...
           END-EVALUATE

    If you would like to open up a support incident with customer care and put my name along with the description I will write this up as a bug report so that development can fix the problem in a future version?

     

Reply
  • Thanks.

    Although this compiles OK for me I do get an error when it is run if ANY is used instead of OTHER in this example.

    Either ANY or OTHER should be allowed as selection objects but they are not interchangeable as they mean different things.

    WHEN OTHER will be true if all the preceding conditions have been evaluated as false.
    WHEN ANY will always be evaluated as true.

    WHEN ANY is normally used when there are multiple selection objects and you really only wish to be evaluating one of them for a specific condition.

    Example:
          EVALUATE     XXX     ALSO     YYY
                   WHEN ANY         ALSO    1      *> XXX can contain any value but YYY must be = 1
                          perform …
                    WHEN 2               ALSO ANY  *> YYY can contain any value but XXX must be = 2
                          perform...
                     WHEN OTHER   *> This will be true only if the previous 2 conditions are evaluated as false.
                          perform ...
           END-EVALUATE

    If you would like to open up a support incident with customer care and put my name along with the description I will write this up as a bug report so that development can fix the problem in a future version?

     

Children