Hi Jim,
 
you cannot mix 64bit Java and 31bit COBOL. As of now there is no COBOL compiler 
that creates 64bit code.
Please switch to the 31bit JVM.
In addition, you can code JNI calls in COBOL, no C wrapper required and compile 
it using JCL.
Please note, that C can produce 64bit code and as such can be used with the 
64bit JVM. But without Assembler you cannot call the 64bit C module from COBOL 
(which is 31bit).
 
You can also find samples of COBOL/Java in the redbook:
New Ways of Running Batch Applications on z/OS: Volume 4 IBM IMS

Although it mentiones IMS and Batch, COBOL/Java interoperability is a Language 
Environment Feature, which is not limited to IMS or Batch.
All the compiles in the Book are done with JCL.

By the way, there is a Java Doc in preparation with samples and discussions for 
COBOL/Java which is expected to be released around mid November, which will 
replace and enhance information from the mentioned redbook.

Denis.

 
-----Original Message-----
From: Jim <j...@thethomasresidence.us>
To: IBM-MAIN <IBM-MAIN@LISTSERV.UA.EDU>
Sent: Wed, Nov 2, 2016 10:15 pm
Subject: Re : Looking for some direction on USS /  JAVA / C / COBOL and or 
Assembler please.

Listers,

For brevity ... I've been trying to get the Standalone Java vol 2 example of 
JAVA calling COBOL (and assembler) via a 
C glue working, unsuccessfully ..  

I'm on a  z/OS 2.2 box, Java 7 x64 only .. I can install 31bit java am hoping I 
won't be limited to that ... 

I've compiled my skeletons, both assembler and COBOL under native z/OS and 
included RENT, DYNAM(DLL) and AMODE64. 


For the Java part .. it's a simple javac programname.java followed by a javah 
programname (class name)... for the 
C part ... I've been using the below .. 

c89 -c -o programname.o -W "c,langlvl(extended)",lp64 -W c,expo,lp64,dll 
-DNEEDSIEE754 -DNEEDSLONGLONG -I/usr/lpp/java/J7.0_64/include programname.c
c89 -Wl,lp64,dll -o libprogramname.so programname.o 
"//'HLQ.PDSE.OBJ(COBOLPROGRAM | ASSEMBLERPROGRAM)'"

With the 'lp64' included .. for the 2nd step (link) .. I keep getting ..

IEW2480W A711 EXTERNAL SYMBOL CEELLIST OF TYPE LD WAS ALREADY DEFINED AS A   
          SYMBOL OF TYPE LD IN SECTION CEEBLLST.                
 IEW2482W A712 THE ORIGINAL DEFINITION WAS IN A MODULE IDENTIFIED BY DDNAME   
          C8921.  THE DUPLICATE DEFINITION IS IN SECTION CELQLLST  IN A MODULE
          IDENTIFIED BY DDNAME SYSLIB.                                   
 IEW2491E 9373 CLASSES C_WSA and C_WSA64 ARE BOTH PRESENT IN THE MODULE.      
FSUM3065 The LINKEDIT step ended with return code 8.                          

I do see that both, the COBOL and assembler objects (under z/OS) are amode 64 / 
rmode any ... I do not know how to do
the same under USS but am going by the options provided to 'c89' ... 

If I remove the 'lp64' option ... it compiles / links fine .. but when I try to 
run (java programname) .. I get a class not found error 
followed by a java.lang.unspecifiedlinkerror ... this is on the java 
System.loadLibrary statement ... when I changed it to 
System.load specifying the full path ... I got an EDC5253S An AMODE64 
application is attempting to load an AMODE31 DLL load
module .. 

Any advice / direction would be appreciated  ...

Kind Regards.

Jim 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to