View previous topic :: View next topic
|
Author |
Message |
seahawk789
New User
Joined: 22 Feb 2010 Posts: 56 Location: Cochin
|
|
|
|
I have a clarification on the FINISH statement.
I understand that FINISH statement is generally used to end a run unit by releasing database resources and to prevent potential time-outs. My query is even if the program does not specify a FINISH explicitly in the code, when the COBOL program completes successfully, does the run-unit terminate and the resources gets freed up by default even if there is no FINISH ?
Is it similar to the case as in files ? I mean something like we do not specify a CLOSE statement of a FILE towards end of a COBOL program. But when program completes the file is automatically closed. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Code: |
DML207
FINISH Not Issued
Reason:
The FINISH statement either has not been coded or has been coded incorrectly. Check the FINISH statement for proper syntax. Note that programming logic for subprograms or for non-IDMS programs may generate this warning automatically; in this case, corrective action is unnecessary.
Severity:
W |
A "FINISH" should always be issued before terminating a program. Issue the FINISH as soon as database I/O is completed to free-up resources and to prevent potential time-outs
Also if you are using RETURN-CODE in your program then the value in it would get overriden by FINISH.
All in All it is recomended not to miss FINISH for thr RUN-UNIT to get it ended otherwise get ready for surprises.
Yes file will be closed at then end. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
Back to top |
|
|
|