We are trying to implement CICS Webservices. We need to call out a JAVA program from COBOL in this process and get a result back from Java.
The SYSTEM command is not working in COBOL to get the result back.
Can anyone help with a sample code.
#EnterpriseDeveloperHi Divakar,
Have you considered to review this documentation link https://www.microfocus.com/documentation/enterprise-developer/ed80/ED-EclipseUNIX/GUID-1021BBC6-644C-4974-B58B-B256360183AA.html this is a tutorial and I believe it should help answer your question.
If you have a specific issue can you share more details on that, e.g. what your SYSTEM command looks like
Regards,
Kim
Hi Divakar,
Have you considered to review this documentation link https://www.microfocus.com/documentation/enterprise-developer/ed80/ED-EclipseUNIX/GUID-1021BBC6-644C-4974-B58B-B256360183AA.html this is a tutorial and I believe it should help answer your question.
If you have a specific issue can you share more details on that, e.g. what your SYSTEM command looks like
Regards,
Kim
Thanks Kim .. we did go through the documentation ....
We are calling SYSTEM in COBOL using the command to execute java.
STRING "C:\\Users\\Administrator\\.jdks\\openjdk-20.0.1\\bin\\javaw"
DELIMITED BY SIZE
" -classpath C:\\Users\\Administrator\\Desktop"
DELIMITED BY SIZE
"\\IMSCONNECT\\lib\\DEMOTestApp "
DELIMITED BY SIZE
WS-JAVA-PARM-1
DELIMITED BY SIZE
"> C:\\hello.txt"
DELIMITED BY SIZE
INTO WS-FILE-NAME.
CALL "SYSTEM" USING WS-FILE-NAME.
Thanks Kim .. we did go through the documentation ....
We are calling SYSTEM in COBOL using the command to execute java.
STRING "C:\\Users\\Administrator\\.jdks\\openjdk-20.0.1\\bin\\javaw"
DELIMITED BY SIZE
" -classpath C:\\Users\\Administrator\\Desktop"
DELIMITED BY SIZE
"\\IMSCONNECT\\lib\\DEMOTestApp "
DELIMITED BY SIZE
WS-JAVA-PARM-1
DELIMITED BY SIZE
"> C:\\hello.txt"
DELIMITED BY SIZE
INTO WS-FILE-NAME.
CALL "SYSTEM" USING WS-FILE-NAME.
Hi, can you share the documentation page you used to create the above code sample, also what is the error when you run this case.
Also can you share the directives used to compile the above code, e.g. are you compiling to native COBOL, which format, e.g. INT or GNT or DLL, are any dialects used or preprocessors, I ask as all of this can affect behaviour.