Loading a COBOL Program or Library

If your COBOL programs are linked into a library file, or if you want to expose entry-points inside a COBOL program, you need to load the library file or programs before making any calls. You can do this using the runtime.cobload() method in runtime.class. For example, to load the programs inside mycbl:

{  
  if (RuntimeSystem.cobload("mycbl") != 0)
     System.out.println("Could not load library\n") ;
  else
     System.out.println("Library loaded successfully\n") ;
}