COBOL

COBOL

COBOL

COBOL is responsible for the efficient, reliable, secure, and unseen day-to-day operations of the world's economy.

 View Only

Why does a IWZ037I message occur when I run a COBOL program?

By Dan Zhang posted Thu April 02, 2020 12:43 PM

  

Message:
IWZ037I The flow of control in program %1 proceeded beyond the last line of the program.  Control returned to the caller of program %1. 


The message is issued by the compiler generated code when execution continues beyond the last COBOL source line. 
The 'goback' and 'stop run' statements skip over this error message generation and go directly to the return-code setting and return logic. 
 
This helps identify ill-formed batch programs that do not have proper 'goback' and 'stop run' endings; as well as to help diagnose EXEC CICS LINK issues. 
 
There are many ways to get this message: 
1) The last paragraph was PERFORMED, or fell into improperly, and so did not terminate (GO TO can cause this, as can a missing or misplaced  'EXIT') 
2) Misspelt 'goback' 
3) Misspelt 'stop run'  (eg: 'STOP-RUN' is not valid)


To avoid this message, you should use 'GOBACK'. 

 

Further information: 
1) EXIT PROGRAM will end a called routine, but is a NO-OP in the main routine; which means that the program flow continues and will cause the IWZ037I message. 
2) GOBACK, from a called program does a return, from the main, it also does a return (to OS/shell) 
3) STOP RUN should, typically, only be used in the main 

0 comments
1 view

Permalink