Skip to main content
Answer

EXIT PARAGRAPH - Not supported in .NET COBOL?

  • December 4, 2025
  • 5 replies
  • 29 views

Peter Restorick
Forum|alt.badge.img

Hi,

I have found that the EXIT PARAGRAPH doesn’t work in .NET COBOL. Is this an error or is it deliberate, and if it is deliberate then is there an alternative?

Thanks in advance

Best answer by Peter Restorick

Me again,

I should have checked further in this - it appears that there is a bit of a display issue when debugging in that the EXIT PARAGRAPH appears to take you to the last line in the paragraph first as opposed to returning to the perform. 

So it does work it is purely a display ‘issue’ in the debugger

5 replies

Peter Restorick
Forum|alt.badge.img
  • Author
  • New Participant
  • Answer
  • December 4, 2025

Me again,

I should have checked further in this - it appears that there is a bit of a display issue when debugging in that the EXIT PARAGRAPH appears to take you to the last line in the paragraph first as opposed to returning to the perform. 

So it does work it is purely a display ‘issue’ in the debugger


Neil Hayes
Forum|alt.badge.img+1
  • Participating Frequently
  • December 4, 2025

This is a simple example. Visual COBOL 11 Update 1 (COBOL .NET in a class)
 

           move "test" to RandomField
           perform test-exitparagraph
           if RandomField = "fail"
               display "error"
           end-if
           .
       test-exitparagraph.
           if RandomField = "test"
               exit paragraph
           end-if

           move "Test1" to RandomField
           move "Test2" to RandomField
           move "Test3" to RandomField
           move "fail"    to RandomField
           .

On selecting step on the exit paragraph line, I would expect the debugger to go to the “If RandomField = “fail” line but instead it drops down to the move “fail” to RandomField, not even the full stop below that, so you thing that line is going to be executed and move “fail” to the RandomField.
 


Chris Glazier
Forum|alt.badge.img+2

Hello,

Have either of you reported this as a product defect, through a support incident?

If not, then I will go ahead and create one.

Thanks


Neil Hayes
Forum|alt.badge.img+1
  • Participating Frequently
  • December 4, 2025

Reference case  01139223


Chris Glazier
Forum|alt.badge.img+2

Thank you, Neil!