Highlighted
Trusted Contributor.
Trusted Contributor.
253 views

COBCH0853S System error - evaluation stack mismatch

Jump to solution

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

 

0 Likes
1 Solution

Accepted Solutions
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Betreff: COBCH0853S System error - evaluation stack mismatch

Jump to solution
Is it when any or when other?
i think when other
Why do you want to Limit nestings?
What is you Problem?

View solution in original post

0 Likes
10 Replies
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Betreff: COBCH0853S System error - evaluation stack mismatch

Jump to solution
Is it when any or when other?
i think when other
Why do you want to Limit nestings?
What is you Problem?

View solution in original post

0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

Betreff: COBCH0853S System error - evaluation stack mismatch

Jump to solution

My problem is, that the following code does not compile with the message

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

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

I don't want to reduce it !

But when I reduce, it compiles, for example:

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

0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

Betreff: COBCH0853S System error - evaluation stack mismatch

Jump to solution

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 ...

0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

Betreff: COBCH0853S System error - evaluation stack mismatch

Jump to solution

I think/hope I found a Solution :

using OTHER instead of ANY

...

MOVE 'J' TO KEZ-AUSGABE
WHEN OTHER MOVE ' ' TO H-TEXT
END-EVALUATE

...

?

0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

Betreff: COBCH0853S System error - evaluation stack mismatch

Jump to solution
Now I understand what you are meaning with 'any or other' ...
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Betreff: COBCH0853S System error - evaluation stack mismatch

Jump to solution

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
0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

Betreff: COBCH0853S System error - evaluation stack mismatch

Jump to solution

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

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Betreff: COBCH0853S System error - evaluation stack mismatch

Jump to solution

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.

 

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Betreff: COBCH0853S System error - evaluation stack mismatch

Jump to solution

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?

 

0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

Betreff: COBCH0853S System error - evaluation stack mismatch

Jump to solution

ok, I will open a support incident 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.