AnsweredAssumed Answered

Send EBCDIC byte stream as Response

Question asked by sdabbiru on Dec 6, 2017
Latest reply on Dec 8, 2017 by sdabbiru

Hi All,

 

We are virtualizing the main frame transactions which are communicated over IBM MQ. Usually the consuming applications publish the request in the form of byte stream on the queues which will be picked up the down stream applications, Process them and publish the response again as a byte stream which will be consumed by the requesting applications.

 

I don't have any issue for requests  which are of ASCII byte streams but when the request is an EBCDIC byte stream , I have the issue.

 

When the consuming application publishes the EBCDIC byte stream , I use the below code to capture the byte request and convert that to a java string to compare against the virtual service transaction.

 

import com.itko.lisa.test.TestExec;

rawMessage = lisa_vse_request.getBodyBytes();
String InputReq = new String(rawMessage, "Cp1047");
lisa_vse_request.setBodyText(InputReq);

 

This converted java string is used by the copy book to identify the matching transaction. once a positive match is identified, the response which is a java string need to be converted back to EBCDIC byte stream.

 

I'm trying the below code but the issue is , the application is not able to consume it.

 

String theBody = lisa_vse_response.getBodyText();
byte[] bytes = theBody.getBytes("Cp1047");
lisa_vse_response.setBodyBytes(bytes);
return bytes;

 

I believe the above code is converting the response java string to EBCDIC byte stream.The CCSID on the request side (Cp1047) converts the request as the correct java string which makes be believe that response should use the same to convert it back to EBCDIC byte stream.Please correct me if I'm missing any.

 

Regards,

Shivakumar.

Outcomes