IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Pass input thru Java and get output in Java


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Kumar Neeraj

New User


Joined: 10 Aug 2007
Posts: 9
Location: Pune

PostPosted: Wed Sep 19, 2007 2:20 pm
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Sep 19, 2007 2:26 pm
Reply with quote

Sounds like a code page translation error, if the CICS is on the mainframe, where is the JAVA?
Back to top
View user's profile Send private message
Kumar Neeraj

New User


Joined: 10 Aug 2007
Posts: 9
Location: Pune

PostPosted: Wed Sep 19, 2007 2:31 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Sep 19, 2007 2:54 pm
Reply with quote

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
View user's profile Send private message
Kumar Neeraj

New User


Joined: 10 Aug 2007
Posts: 9
Location: Pune

PostPosted: Wed Sep 19, 2007 5:17 pm
Reply with quote

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
View user's profile Send private message
pingte

Active User


Joined: 03 Dec 2005
Posts: 120
Location: india

PostPosted: Wed Sep 19, 2007 6:07 pm
Reply with quote

What is the middle ware u are using to connect JAVA to CICS?
Back to top
View user's profile Send private message
Kumar Neeraj

New User


Joined: 10 Aug 2007
Posts: 9
Location: Pune

PostPosted: Wed Sep 19, 2007 7:11 pm
Reply with quote

I am not using any middleware as such....i am using ECI ( External Call Interface)
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Sep 19, 2007 8:52 pm
Reply with quote

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
View user's profile Send private message
ramco_sita

New User


Joined: 25 Jun 2007
Posts: 40
Location: chennai

PostPosted: Sun Sep 23, 2007 9:16 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
Search our Forums:

Back to Top