Ad
  • Default User Avatar

    closing, as it seems the issue comes from your code

  • Default User Avatar

    to me it looks like you are not properly resetting the FLAG variable in your procedure. As a result, it carries its value between calls. At the end of the 3rd test, it is set to 1, so in the 4th test, this branch is not entered like it should:

          IF FLAG = 0
             MOVE 1 TO result
    

    You are also leaving result undefined at that point if FLAG is not 0, which is not robust. You are being "lucky" that the test case do not reset it to some arbitrary value in-between calls to StringEndsWith

  • Default User Avatar

    please edit your message to include your entire code, not just the algorithm. And add the cobol language ID after the ``` backticks

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution