If you wish to simulate the COBOL CANCEL verb from C, you can do so by calling the following routine:
void acu_cancel( program ) char *program;
You pass this routine the name of the program you want to cancel. This name should be identical to the string that you passed to the acu_cobol() function to call that program. Canceling a program releases the memory it occupies and resets its internal data to its initial state if you call the program again. Also, any files left open in the program are closed. If program does not match the name of any COBOL program in memory, then nothing happens when you call this routine.