Natural

Can you please let me know the equivalent statement in Natural for a COBOL GOTO statement

Ima getting the below error. Cannot I put a loop statement within a DO….DOEND ??? what is the solution

NAT0611: Loop/condition not properly closed.
Text Loop/condition not properly closed.
Expl. An active loop or condition was not properly closed.
For example, in structured mode, a FIND statement was
issued without a corresponding END-FIND statement.
Actn. Check program and correct error

There is no direct equivalent to GOTO in Natural. You can, however, CALL, CALLNAT, FETCH, or PERFORM from Natural to invoke external or internal objects and subroutines, so logically you can branch out to other code. The intent of structured programming is that you will return to where you branched from, but it’s possible to not do so if that’s your intent.

You can also ESCAPE from your processing loop or routine or TERMINATE altogether.

Hope this helps.

Regarding your NAT0611, can you provide the code snippet? You can definitely insert a processing loop within a DO/DOEND (assuming reporting mode here). As long as your loops are nested, you’re ok.