Rational Developer for System z
COBOL for Windows, Version 7.5, Programming Guide


Terminating preinitialized COBOL environment

Use the following interface to terminate the preinitialized persistent COBOL environment.

CALL term_routine syntax
Read syntax diagramSkip visual syntax diagram>>-CALL--term_routine(function_code,error_code)----------------><
 
CALL
Invocation of term_routine, using language elements appropriate to the language from which the call is made
term_routine
The name of the termination routine: _iwzCOBOLTerm or IWZCOBOLTERM (using OPTLINK linkage convention), or _IwzCOBOLTerm (using STDCALL linkage convention)
function_code (input)
A 4-byte binary number, passed by value. function_code can be:
1
Clean up the preinitialized COBOL runtime environment as if a COBOL STOP RUN statement were performed; for example, all COBOL files are closed. However, the control returns to the caller of this service.
 
error_code (output)
A 4-byte binary number. error_code can be:
0
Termination was successful.
1
Termination failed.
 

The first COBOL program called after the invocation of the preinitialization routine is treated as a subprogram. Thus a GOBACK from this (initial) program does not trigger run-unit termination semantics such as the closing of files. Run-unit termination (such as with STOP RUN) does free the preinitialized COBOL environment prior to the invocation of the run-unit exit routine.

If not active: If your program invokes the termination routine and the COBOL environment is not already active, the invocation has no effect on execution, and control is returned to the invoker with an error code of 0.

Example: preinitializing the COBOL environment

related references
Call interface conventions


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)