View previous topic :: View next topic
|
Author |
Message |
Kumar Neeraj
New User
Joined: 10 Aug 2007 Posts: 9 Location: Pune
|
|
|
|
I have written a code which writes the hard coded data on to the commarea.
I tried invoking this prog thru Java. We pass input thru Java and get output in Java.
The string ‘ABCDEabcde12345AAAAAAAAAAAAAAAAAAAAAAAAA' is the output of CICS prog.
But while reading thru Java this is being displayed as ?cdeµ¥þ©§¹ùúÿ?????????????????????????
Let me know if any solution. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Sounds like a code page translation error, if the CICS is on the mainframe, where is the JAVA? |
|
Back to top |
|
|
Kumar Neeraj
New User
Joined: 10 Aug 2007 Posts: 9 Location: Pune
|
|
|
|
I could not understand what you are asking...can you tell me what is this code page trnaslation error and how it can be resolved? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
well, lets start with this. Java only deals with unicode. CICS only deals with ebcdic. Unless you have designated otherwise, what CICS generated gets sent to the JAVA program. Between the two, you need to tell the interface software ('twn CICS and JAVA) that you need to convert the data. |
|
Back to top |
|
|
Kumar Neeraj
New User
Joined: 10 Aug 2007 Posts: 9 Location: Pune
|
|
|
|
i have checked there is no such interface issue....like what we are doing is we are just har coding it into the code just to check the pgm.....can you tell me how to trace the fault in the code....??? |
|
Back to top |
|
|
pingte
Active User
Joined: 03 Dec 2005 Posts: 120 Location: india
|
|
|
|
What is the middle ware u are using to connect JAVA to CICS? |
|
Back to top |
|
|
Kumar Neeraj
New User
Joined: 10 Aug 2007 Posts: 9 Location: Pune
|
|
|
|
I am not using any middleware as such....i am using ECI ( External Call Interface) |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
The java is running on a desktop, correct?
I suspect that what has happened is that the transfer from CICS to java was done as a binary transfer - it needs to be an ascii transfer. |
|
Back to top |
|
|
ramco_sita
New User
Joined: 25 Jun 2007 Posts: 40 Location: chennai
|
|
|
|
i think you are using ECI request CTG base class to interface to CICS.
First you need to pass the exact length of the commarea in your string. The cobol/CICS program and your java code should have the same length.
You need to do conversion in java .
byte commarea[] = ("----").getBytes("IBM037");
when u pass it to the commarea you have to conversion and the same way when u get the value returned from cobol to java also you have to do the conversion.
Hope this works...
the sample code
mport com.ibm.ctg.client.JavaGateway;
import com.ibm.ctg.client.*;
import java.io.*;
public class Comm
{
public static void main(String args[]) throws IOException
{
try
{
JavaGateway jg = new JavaGateway("localhost",2006);
byte commarea[] = ("----").getBytes("IBM037");
ECIRequest req= new ECIRequest(ECIRequest.ECI_SYNC,"CICS1","dsrm022","password","m22ap03","m22c",commarea,4,
ECIRequest.ECI_NO_EXTEND,
ECIRequest.ECI_LUW_NEW);
System.out.println("Comm in: " + new String(req.Commarea, "IBM037"));
jg.flow(req);
System.out.println("Comm out: " + new String(req.Commarea, "IBM037"));
System.out.println("Rc: " + req.getRc());
jg.close();
}catch (IOException ioe) {
System.out.println("Handled exception: " + ioe.toString());
}
}
} |
|
Back to top |
|
|
|