Admin Production rocket
Current Publication

cobtidy

Enterprise Developer for Eclipse (including UNIX Components) V7.0
Rocket® Enterprise Developer (formerly a product of Micro Focus or formerly a product of Open Text) documentation, created before Rocket Software acquired certain products from OpenText, may include outdated references to "Micro Focus" or "OpenText", both of which are trademarks of OpenText or its affiliates. Rocket Software is not affiliated with Micro Focus or OpenText and has since rebranded these products as Rocket® products. You may also encounter outdated links in this documentation. If you do, please contact Rocket Support (support@rocketsoftware.com) for assistance.

cobtidy

Tidies up the global COBOL run-time environment.
Restriction: This function is supported for native COBOL only.

Syntax:

#include "cobmain.h"

int cobtidy (void);

Parameters:

None.

Comments:

This function deinitializes the COBOL environment, emptying buffers, closing files and freeing any data areas allocated by the COBOL system.

Use this function if you want to close down the COBOL system, but are not yet ready to exit. It returns 0 on success.

Do not call cobtidy() directly from a COBOL program.

You can call this function only when all COBOL modules have been exited, and you do not intend to re-enter them. If you do call any COBOL entry points or COBOL routines (such as cobinit()) after you have called cobtidy(), the results are undefined.

Equivalent COBOL Syntax:

None.

Example:

The following example shows how to initialise and close down the COBOL environment from a C main(), so that a COBOL program can be called:

main(int argv, char *argv)
{
    cobinit();            /* Initialize COBOL environment */

    cobcall("cobep", 0, NULL); /* Call a COBOL program */

    cobtidy();            /* Close down COBOL environment */

    return(0);
}