Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Pass input thru Java and get output in Java

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: Pass input thru Java and get output in Java
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: 2150
Location: At my coffee table

PostPosted: Wed Sep 19, 2007 2:26 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Wed Sep 19, 2007 8:52 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us