Actually a better place to set the environment variables would be within the instantiated RunUnit itself so that this would not be set globally.
There is a SetEnvironmentVariable method in the RunUnit class:
Example:
MicroFocus.COBOL.RuntimeServices.RunUnit myRunUnit = new MicroFocus.COBOL.RuntimeServices.RunUnit(); try { // Call the COBOL program COBPROG cp = new COBPROG(); myRunUnit.Add(cp); myRunUnit.SetEnvironmentVariable("dd_NEW", "C:\\temp"); myRunUnit.Call("COBPROG", "11111111111111111111"); } finally { // Destroy the run unit myRunUnit.StopRun(); }