Called program file not found in drive/directory.(Visual COBOL 2.1 for RedHat)

I called a native COBOL program in a junit JVM COBOL.(CALL "SS2401" USING SS2401-IN)But when I run the JVM COBOL in
the command line,there is a error.[Called program file not found in drive/directory (173)]
I already set the path of native COBOL up in the $COBPATH,$PATH and $CLASSPATH and runned the cobsetenv script to set up my environment.
And in the path of native COBOL's folder ,there are and SS2401.o files.


[root@rhcs32 bin]# java org.junit.runner.JUnitCore junit.SS2401_test
JUnit version 4.8.2
Time: 0.157
There were 2 failures:
1) test1(junit.SS2401_test)
com.microfocus.cobol.program.COBOLProgramNotFound: Called program file not found in drive/directory (173) [SS2401]
at com.microfocus.cobol.program.Control.callReturningObject(Unknown Source)
at Source)
at junit.SS2401_test.test1(SS2401_test.cbl:153)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at junit.framework.TestCase.runTest(
at junit.framework.TestCase.runBare(
at junit.framework.TestResult$1.protect(
at junit.framework.TestResult.runProtected(
at junit.framework.TestSuite.runTest(
at org.junit.runners.Suite.runChild(
at org.junit.runners.Suite.runChild(
at org.junit.runners.ParentRunner$
at org.junit.runners.ParentRunner$1.schedule(
at org.junit.runners.ParentRunner.runChildren(
at org.junit.runners.ParentRunner.access$000(
at org.junit.runners.ParentRunner$2.evaluate(
at org.junit.runner.JUnitCore.runMain(
at org.junit.runner.JUnitCore.runMainAndExit(
at org.junit.runner.JUnitCore.main(


  • Verified Answer

    The difficulty might be that you need to use "cobjrun" instead of "java" to invoke the process.  Search the documentation for the keyword "cobjrun".  At one point the documentation says:

    Java/COBOL Application Launcher

    Restriction: This topic applies to UNIX environments (remote

    development) only.

    Restriction: This applies to native code only.

    The Java/COBOL application launcher, cobjrun, is used to launch a Java

    application from a COBOL run-time environment. cobjrun is the trigger

    for cobjrun32 and cobjrun64 and should be used instead of your usual

    Java application launcher as it sets up your environment to correctly

    manage both the COBOL run-time system and the Java Virtual Machine.

    In another section entitled, "Setting Up the Environment for Java and COBOL" (the same section where the "cobsetenv" script is described), it says:

    To run COBOL and Java together, you need to use the Java/COBOL

    application launcher, cobjrun, instead of the java or cobrun triggers.

    To test whether this might be the answer, instead of your original command line:

    java org.junit.runner.JUnitCore junit.SS2401_test

    Try the following command line (where "java" is replaced by "cobjrun"):

    cobjrun org.junit.runner.JUnitCore junit.SS2401_test