Skip to main content
Peter Restorick
Inspiring
Dec 4, 2025 9:00 AM UTC
Solved

EXIT PARAGRAPH - Not supported in .NET COBOL?

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

Peter Restorick
Inspiring
Dec 4, 2025 11:24 AM UTC

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
Peter RestorickAuthorAnswer
Inspiring
Dec 4, 2025 11:24 AM UTC

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
Participating Frequently
Dec 4, 2025 11:44 AM UTC

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
Moderator
Dec 4, 2025 1:26 PM UTC

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
Participating Frequently
Dec 4, 2025 1:49 PM UTC

Reference case  01139223

Chris Glazier
Moderator
Dec 4, 2025 2:58 PM UTC

Thank you, Neil!