When you have advanced recovery logging enabled, you can use the exit procedure fsexitproc.cbl to programmatically control logging, recovery and backup behavior.
The exit procedure is located in the %ProgramFiles(x86)%\Micro Focus\Visual COBOL for Visual Studio 2013\cpylib.
To use the exit procedure, you must compile it, then deploy it to the Fileshare working directory. The procedure is fully annotated with details on how you can use it, and some examples of its use are given in Best Practices for Advanced Logging.