Thanks Alan, but I do not have J7.1 available.  I also notice you are using 
"lib/s390" for the "libjvm.x" binder input and for the LIBPATH, but in my J7.0 
directory I only have "libjvm.x" and "linjvm.so" in "J7.0/lib/s390/classic" and 
also in "J7.0/lib/s390/j9vm".

Which one do you think I should be using for J7.0, "classic" or "j9vm"?

Also, if it is not too sensitive, what does your $PATH look like during your 
execution?  I am initially trying this from JCL as in the original example, so 
I was thinking my STEPLIB may need to match the right $PATH settings.

I will try your make from a telnet shell tomorrow if I can find some time.  I 
haven't done that before in a z/OS shell, so for expedience I may have to turn 
the make steps into a simpler shell script to start with.

Thanks again very much for your help.

Peter

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf 
Of Allan Kielstra
Sent: Monday, September 11, 2017 1:10 PM
To: [email protected]
Subject: Re: COBOL calling Java - S922 error

I did get this to work using USS.  I had to change the following calls:

           Call "IBMZOS_NewStringPlatform"
           Call "IBMZOS_NewStringPlatform"
           CALL 'IBMZOS_GetStringPlatformLength'
           CALL 'IBMZOS_GetStringPlatform'

(I don't know why that change was made, but it was)

Here is my Makefile:
PROG = IBMEXAM2
CLASSFILES = HelloJ.class IBMExample2.class
JAVABASE = /usr/lpp/java/IBM/J7.1
COBBASE = /usr/lpp/cobol/igy420

run: $(PROG) $(CLASSFILES)
        _CEE_RUNOPTS="XPLINK(ON)" CLASSPATH=. 
LIBPATH=$(JAVABASE)/lib/s390:$(JAVABASE)/bin/classic ./$(PROG)

%.class: %.java
        $(JAVABASE)/bin/javac $^

$(PROG): $(PROG).o
        $(COBBASE)/bin/cob2 -o $(PROG) $(PROG).o $(JAVABASE)/lib/s390/libjava.x 
$(COBBASE)/lib/igzcjava.x

%.o: %.cbl
        $(COBBASE)/bin/cob2 -c -I $(COBBASE)/include $^

clean:
        rm -f *.class $(PROG) $(PROG).o

Here is what happens when I type gmake run
make clean run
rm -f *.class IBMEXAM2 IBMEXAM2.o
/usr/lpp/cobol/igy420/bin/cob2 -c -I /usr/lpp/cobol/igy420/include IBMEXAM2.cbl
 PP 5655-S71 IBM Enterprise COBOL for z/OS  4.2.0 in progress ...
 End of compilation 1,  program IBMEXAM2,  no statements flagged.
/usr/lpp/cobol/igy420/bin/cob2 -o IBMEXAM2 IBMEXAM2.o 
/usr/lpp/java/IBM/J7.1/lib/s390/libjava.x /usr/lpp/cobol/igy420/lib/igzcjava.x
/usr/lpp/java/IBM/J7.1/bin/javac HelloJ.java
/usr/lpp/java/IBM/J7.1/bin/javac IBMExample2.java
_CEE_RUNOPTS="XPLINK(ON)" CLASSPATH=. 
LIBPATH=/usr/lpp/java/IBM/J7.1/lib/s390:/usr/lpp/java/IBM/J7.1/bin/classic 
./IBMEXAM2
B100-INITIALISE.
B200-INIT-INPUT-VALUES
Call "NewStringPlatform"  inStringBuf.....
B300-INIT-OUTPUT-VALUES
Call "NewStringPlatform"  outStringBuf.....
C100-MAIN.
About to call HelloJ
Hello World, from Java! 2
Returned from sayHello  data2 = 000003
About to call IBMExample2 & pass a string
IBM Example input = Hello
IBM Example output = HelloAdded Text
Just returned from JAVA
Method:GetStringPlatformLength returned (0000000016)
Method:GetStringPlatformString returned (HelloAdded Text^@)
STOP RUN.

I haven't tried it using JCL.  

----------------------------------------------------------------------


This message and any attachments are intended only for the use of the addressee 
and may contain information that is privileged and confidential. If the reader 
of the message is not the intended recipient or an authorized representative of 
the intended recipient, you are hereby notified that any dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please notify us immediately by e-mail and delete the message and any 
attachments from your system.


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to