Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4356

RE: Call from WCF TO COOBOL

$
0
0

If you are trying to call a procedural COBOL program from a C# program running as a WCF service then you should do this by creating a RunUnit in C# and then calling the COBOL program within the RunUnit.

Please see the documentation here

This will direct you to open up the file MicroFocus.COBOL.RuntimeServices.chm, which is installed in the Help folder of your installation. Within this help file are examples of how to call COBOL using the RunUnit class from C#.

.Example:

Create a run unit for the called COBOL program
MicroFocus.COBOL.RuntimeServices.RunUnit myRunUnit = 
      new MicroFocus.COBOL.RuntimeServices.RunUnit();
 try
 {
   // Call the COBOL program
   result = myRunUnit.Call("Program1", "Alice", 21);
   result2 = myRunUnit.Call("Program2");
 }
 finally
 {
   // Destroy the run unit
   myRunUnit.StopRun();
 }

Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>