Author |
Message
|
naylak |
Posted: Thu Oct 16, 2003 3:55 am Post subject: Data conversion from s/390 to windows |
|
|
Apprentice
Joined: 08 Feb 2003 Posts: 47
|
Hi I am sending a message from S/390 to windows machine. In order to perform the data conversion I have set the Data conversion property of sender channel to yes on s/390 which is by default no. On the windows machine in the receiving application I have set the option MQGMO_CONVERT. I have received the message but not converted to ascii. Please help me in solving the problem.
Thanks in advance
naylak |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Oct 16, 2003 5:28 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
There are two different basic ways to convert data from one character set to another. The first is to enable sender conversion on the channel. The second is to specify the Convert option on the GetOptions structure. It does not hurt to do both, but it doesn't help either.
Data conversion will not happen with either of these options, however, if the Format field in the MQMD is set to something that MQSeries does not know about. Typically, this happens because you set it to MQFMT_NONE(the default) in the sending application.
If you are posting only character based data in your message, then the sending application should set the Format field to MQFMT_STRING. If your sending application is not setting the Format field, and you cannot change your sending application, you are out of luck and will have to do the data conversion yourself, in your receiving application.
It is a better overall design to not rely on sender conversion, and instead only use the Convert option in the Get. The reason for this is that you may have an entire network of queue managers between the sending application and the receiving application. If, for instance, your OS/390 application puts the message to a gateway queue manager hosted on Linux (with conversion set on the sender channel), but the real destination for the message is on a Windows queue manager and the channels between the Linux box and the Windows box are not doing sender conversion, then your Windows application will receive data in the character set on the Linux box not the Windows character set. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
naylak |
Posted: Thu Oct 16, 2003 6:19 am Post subject: |
|
|
Apprentice
Joined: 08 Feb 2003 Posts: 47
|
Thanks for the suggestion. I have tried with what you have said, but nothing difference occurred. Can you suggest me some more?
Thanks in advance
naylak |
|
Back to top |
|
 |
mrlinux |
Posted: Thu Oct 16, 2003 9:32 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
That is it, if the MQMD.Fromat String is set to MQSTR and you do MQGET
with Convert it will be converted, if there are any conversion errors it
will show up in the reason code. _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
naylak |
Posted: Fri Oct 17, 2003 6:16 am Post subject: |
|
|
Apprentice
Joined: 08 Feb 2003 Posts: 47
|
I think the code I have written and the message on various platforms will
give you some more information regarding solving the problem.
1. First message was created on windows machine and is sent to S/390 machine. The sample code is as follows:
import com.ibm.mq.*; // Include the MQ package
import java.io.*;
import java.lang.*;
import java.sql.*;
import com.security.*;
import com.security.exception.*;
public class MQEncryptDemo
{
private MQQueueManager qMgr;
private String qmgrName;
private String queueName;
private String message;
public static void main (String args [] )
{
MQEncryptDemo mySample = new MQEncryptDemo();
mySample.start();
}
public void start()
{
StringBuffer bufEncryptedMessage = new StringBuffer();
StringBuffer bufDigitalSignature = new StringBuffer();
StringBuffer bufCheckSum = new StringBuffer();
try
{
SecurityWrap securityObj =null ;
try
{
securityObj = new SecurityWrap();
}
catch(SecurityExceptionBase seb)
{
System.out.println("Security Exception Occured while creating the Security object.");
System.exit(0);
}
System.out.println("MQGetDemo started...");
qMgr = new MQQueueManager("SFMS.SSQM");
queueName = "SFMS.SNDRBFSEC";
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF| MQC.MQOO_INQUIRE ;
MQQueue myQueue = qMgr.accessQueue(queueName, openOptions,null, null, null);
System.out.println("The Number of messages in the queue are:"+myQueue.getCurrentDepth());
MQMessage myMessage = new MQMessage();
MQGetMessageOptions pmo = new MQGetMessageOptions();
pmo.options = pmo.options | MQC.MQPMO_SYNCPOINT ;
myQueue.get(myMessage, pmo);
message = myMessage.readString(myMessage.getMessageLength());
//message = "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~???????????????????????????????? ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ";
System.out.println("Reached for Encrypting the message.");
int securityResCode = securityObj.encryptAndSign(message,
"RBIS",
"RBIS", "secret",
2,
bufEncryptedMessage,
bufDigitalSignature,bufCheckSum);
StringBuffer bufMesgAftEnc = new StringBuffer();
myQueue.close();
String mesgAftEnc = (bufMesgAftEnc.append
(bufEncryptedMessage.toString()).append("dig").append
(bufDigitalSignature.toString()).append("chk").append
(bufCheckSum.toString())).toString();
System.out.println("Message After Encryption"+mesgAftEnc);
/* char[] ch = new char[mesgAftEnc.length()];
mesgAftEnc.getChars(0,mesgAftEnc.length(),ch,0);
char[] ch1 = new char[mesgAftEnc.length()];
//EbcdicAscii.EbcdicToAscii(ch,ch1);
EbcdicAscii.AsciiToEbcdic(ch,ch1);
mesgAftEnc = new String(ch1);*/
openOptions = MQC.MQOO_OUTPUT ;
myQueue = qMgr.accessQueue("SFMS.SNDRAFTSEC", openOptions, null, null, null);
myMessage = new MQMessage();
myMessage.format = MQC.MQFMT_STRING;
myMessage.writeString(mesgAftEnc);
myMessage.format = MQC.MQFMT_STRING;
MQPutMessageOptions pmo1 = new MQPutMessageOptions();
//pmo.options = pmo.options ;
myQueue.put(myMessage, pmo1);
myQueue.close();
qMgr.disconnect();
//System.out.println("The message retrieved from the queue is: \r\n queue is: \r\n \r\n"+myMessage.readString(myMessage.getMessageLength()));
}
catch (MQException ex)
{
System.out.println("An MQ error occurred: " + ex.completionCode + " " +ex.reasonCode);
ex.printStackTrace();
//qMgr
}
catch (java.lang.Exception ex)
{
System.out.println("Java exception: " + ex);
ex.printStackTrace();
}
System.out.println("MQGetDemo finished...");
}
}
The message that was put using the above code is as follows:
MIME-Version: 1.0
Content-Disposition: attachment; filename="smime.p7m"
Content-Type: application/x-pkcs7-mime; name="smime.p7m"
Content-Transfer-Encoding: base64
MIIBrgYJKoZIhvcNAQcDoIIBnzCCAZsCAQAxggFHMI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pe/eER6fmCHx0lfYjvWw0Qcwpgil2MJRE9RhUjp6Uu4wzSVU5nX6aK
cy9X0h0Yact0m6KJBMAuMYIBsTCCAa0CAQEwgaswgaQxCzAJBgNVBAYTAkluMRcw
FQYDVQQIEw5BbmRocmEgUHJhZGVzaDEgMB4GA1UEChMXVGF0YSBDb25zdWx0YW5j
eSBDZW50ZXIxIzAhBgNVBAsTGkFkdmFuY2VkIFRlY2hub2xvZ3kgQ2VudGVyMREw
DwYDVQQDEwhBVEMtQ0EtMTEiMCAGCSqGSIb3DQEJARYTYXRjQ0FAYXRjLnRjcy5j
by5pbgICAakwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEw
HAYJKoZIhvcNAQkFMQ8XDTAzMTAxNzEyMjMwNlowIwYJKoZIhvcNAQkEMRYEFBNI
g/Y0LOqKrGuMOU3KC3d16L14MA0GCSqGSIb3DQEBAQUABIGAE7kiCNTodJr/tDMO
xeT8hVrPlElCGVK7BwP3yyVVm6q6tofCEADX9x5apWxKtWb/kzBvcMjg/Sik7rNH
FdEb/Ak33RZ/9txelxKdrMH3tKoObQoPQK3ZTc3lwIWyTd9Tupnr62g5ERjlW6U5
3ZyMq4i8hxbr/WhKV9QLgKfwNpk=
-----END PKCS7-----
chk94F513B790C1117B4F615C1729E4720D
The message that was retrieved on S/390 machine is as follows:
MIME-Version: 1.0
Content-Disposition: attachment; filename="smime.p7m"
Content-Type: application/x-pkcs7-mime; name="smime.p7m"
Content-Transfer-Encoding: base64
MIIBrgYJKoZIhvcNAQcDoIIBnzCCAZsCAQAxggFHMIIBQwIBADCBqzCBpDELMAkG
A1UEBhMCSW4xFzAVBgNVBAgTDkFuZGhyYSBQcmFkZXNoMSAwHgYDVQQKExdUYXRh
IENvbnN1bHRhbmN5IENlbnRlcjEjMCEGA1UECxMaQWR2YW5jZWQgVGVjaG5vbG9n
eSBDZW50ZXIxETAPBgNVBAMTCEFUQy1DQS0xMSIwIAYJKoZIhvcN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VBAsTGkFkdmFuY2VkIFRlY2hub2xvZ3kgQ2VudGVyMREw
DwYDVQQDEwhBVEMtQ0EtMTEiMCAGCSqGSIb3DQEJARYTYXRjQ0FAYXRjLnRjcy5j
by5pbgICAakwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEw
HAYJKoZIhvcNAQkFMQ8XDTAzMTAxNzEyMjMwNlowIwYJKoZIhvcNAQkEMRYEFBNI
g/Y0LOqKrGuMOU3KC3d16L14MA0GCSqGSIb3DQEBAQUABIGAE7kiCNTodJr/tDMO
xeT8hVrPlElCGVK7BwP3yyVVm6q6tofCEADX9x5apWxKtWb/kzBvcMjg/Sik7rNH
FdEb/Ak33RZ/9txelxKdrMH3tKoObQoPQK3ZTc3lwIWyTd9Tupnr62g5ERjlW6U5
3ZyMq4i8hxbr/WhKV9QLgKfwNpk=
-----END PKCS7-----
chk94F513B790C1117B4F615C1729E4720D
The code used to get the above message from the queue and again to put the queue is as follows:
import com.ibm.mq.*; // Include the MQ package
import java.io.*;
import java.lang.*;
import java.sql.*;
public class MQGetPut
{
private MQQueueManager qMgr;
private String qmgrName;
private String queueName;
private String message;
public static void main (String args ݨ) throws Exception
{
MQGetPut mySample = new MQGetPut();
mySample.start();
}
public void start() throws MQException
{
try
{
System.out.println("MQGetDemo started...");
qMgr = new MQQueueManager("SFMD");
queueName = "SFMS.SNDRAFTSEC";
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF| MQC.MQOO_INQUIRE ;
MQQueue myQueue = qMgr.accessQueue(queueName, openOptions,null, null, null);
System.out.println("The Number of messages in the queue are:"+myQueue.
MQMessage myMessage = new MQMessage();
MQGetMessageOptions pmo = new MQGetMessageOptions();
pmo.options = MQC.MQGMO_WAIT | MQC.MQGMO_FAIL_IF_QUIESCING | MQC.MQGMO_CONVERT;
myQueue.get(myMessage, pmo);
message = myMessage.readString(myMessage.getMessageLength());
myQueue.close();
openOptions = MQC.MQOO_OUTPUT ;
queueName = "SFMS.RCVRBFSEC";
myQueue = qMgr.accessQueue(queueName, openOptions, null, null, null);
myMessage = new MQMessage();
myMessage.format = MQC.MQFMT_STRING;
myMessage.writeString(message);
MQPutMessageOptions pmo1 = new MQPutMessageOptions();
myQueue.put(myMessage, pmo1);
myQueue.close();
qMgr.disconnect();
}
catch (MQException ex)
{
System.out.println("An MQ error occurred: " + ex.completionCode + " " +ex.reasonCode);
ex.printStackTrace();
}
catch (java.lang.Exception ex)
{
System.out.println("Java exception: " + ex);
ex.printStackTrace();
}
System.out.println("MQGetDemo finished...");
}
}
The message that was received on the windows machine is as follows:
MIME-Version: 1.0?Content-Disposition: attachment; filename="smime.p7m"?Content-Type: application/x-pkcs7-mime; name="smime.p7m"?Content-Transfer-Encoding: base64??MIIBrgYJKoZIhvcNAQcDoIIBnzCCAZsCAQAxggFHMIIBQwIBADCBqzCBpDELMAkG?A1UEBhMCSW4xFzAVBgNVBAgTDkFuZGhyYSBQcmFkZXNoMSAwHgYDVQQKExdUYXRh?IENvbnN1bHRhbmN5IENlbnRlcjEjMCEGA1UECxMaQWR2YW5jZWQgVGVjaG5vbG9n?eSBDZW50ZXIxETAPBgNVBAMTCEFUQy1DQS0xMSIwIAYJKoZIhvcNAQkBFhNhdGND?QUBhdGMudGNzLmNvLmluAgIBqTANBgkqhkiG9w0BAQEFAASBgB/Y/Q+s0tDVXoRK?tQJDabNoPvG6uZKSISQ7woN9znMAsBXGwbHLF+x9qJciGcZppFGxh275ajmlhM4O?gTBsBjANAZI7a3JPeS66NMzcFUoy4C3/lO3WiImjnwoiF8nYT6N7Odku266YgEem?e7Ppyo9ZqSkW6jlk9waN33A95/ckMEsGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQI?6Y/TQqrf2xaAKL6/1Bc9I8k8qpbpzAa1m82gumAGCeumJQbEiKNf16Z3gvceLP+/?yDs=??dig-----BEGIN PKCS7-----?MIIGcAYJKoZIhvcNAQcCoIIGYTCCBl0CAQExCzAJBgUrDgMCGgUAMAsGCS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Tc3lwIWyTd9Tupnr62g5ERjlW6U5?3ZyMq4i8hxbr/WhKV9QLgKfwNpk=?-----END PKCS7-----?chk94F513B790C1117B4F615C1729E4720D
Note:Wherever the new line character is there now ? is appearing.
The code used to retrieve the message on windows machine is as follows:
import com.ibm.mq.*; // Include the MQ package
import java.io.*;
import java.lang.*;
import java.sql.*;
public class MQBrowseDemo
{
private MQQueueManager qMgr;
private String qmgrName;
private String queueName;
public static void main (String args [] )
{
MQBrowseDemo mySample = new MQBrowseDemo();
mySample.start();
}
public void start()
{
try
{
System.out.println("MQBrowseDemo started...");
qMgr = new MQQueueManager("SFMS.SSQM");
queueName = "SFMS.RCVRBFSEC";
int openOptions = MQC.MQOO_BROWSE| MQC.MQOO_INQUIRE;
MQQueue myQueue = qMgr.accessQueue(queueName, openOptions,
null, null, null);
System.out.println("The Number of messages in the queue are:"+myQueue.getCurrentDepth());
MQMessage myMessage = new MQMessage();
// myMessage.writeString("Hi Raju");
// myMessage.format = MQC.MQFMT_STRING;
MQGetMessageOptions pmo = new MQGetMessageOptions();
pmo.options = MQC.MQGMO_BROWSE_FIRST | MQC.MQGMO_CONVERT;
myQueue.get(myMessage, pmo);
/*String msg = myMessage.readString(myMessage.getMessageLength());
char[] ch = new char[msg.length()];
msg.getChars(0,msg.length(),ch,0);
char[] ch1 = new char[msg.length()];
EbcdicAscii.EbcdicToAscii(ch,ch1);
//EbcdicAscii.AsciiToEbcdic(ch,ch1);
String str = new String(ch1);
//System.out.println(str);*/
System.out.println("The message retrieved from the queue is: \r\n \r\n"+myMessage.readString(myMessage.getMessageLength()));
//System.out.println("The message retrieved from the queue is: \r\n \r\n"+str);
System.out.println("The Number of messages in the queue are:"+myQueue.getCurrentDepth());
//qMgr.backout();
myQueue.close();
// myQueue = qMgr.accessQueue(queueName, openOptions,
//null, null, null);
// System.out.println("The Number of messages in the queue are:"+myQueue.getCurrentDepth());
qMgr.disconnect();
}
catch (MQException ex)
{
System.out.println("An MQ error occurred: " + ex.completionCode + " " +
ex.reasonCode);
ex.printStackTrace();
}
catch (java.lang.Exception ex)
{
System.out.println("Java exception: " + ex);
ex.printStackTrace();
}
System.out.println("MQBrowseDemo finished...");
}
}
Thanks in advance
with regards
naylak |
|
Back to top |
|
 |
mrlinux |
Posted: Fri Oct 17, 2003 6:31 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
Am I reading the code correctly and that you are converting the message from ascii to ebcdic before sending it to OS390 _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
naylak |
Posted: Fri Oct 17, 2003 6:57 am Post subject: |
|
|
Apprentice
Joined: 08 Feb 2003 Posts: 47
|
Thanks for the response. Actually that part of code is commented with /* */
with regards
naylak |
|
Back to top |
|
 |
mrlinux |
Posted: Fri Oct 17, 2003 7:22 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
Well the way you are testing is by putting an acsii message on the mainframe queue ?? The message is sitting on the queue in acsii, which doesnt following your requirements of sending a Message from the mainframe to windows. The mainframe would place the message in the queue as ebcdic.
Also are you client connecting to the mainframe for this test ??? _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
naylak |
Posted: Fri Oct 17, 2003 7:37 am Post subject: |
|
|
Apprentice
Joined: 08 Feb 2003 Posts: 47
|
Well, the program is not directly putting the message on mainframe Queue. Instead it is placing message on its remote queue configured for the mainframe and the message is transmitted using channels configured between windows machine and mainframe machine. The message on windows machine is being received in ascii form and the same message is being forwarded to windows machine through mq. While receiving the message on windows the new line character is received as ?.
Thanks and regards
naylak |
|
Back to top |
|
 |
naylak |
Posted: Fri Oct 17, 2003 7:43 am Post subject: |
|
|
Apprentice
Joined: 08 Feb 2003 Posts: 47
|
Sorry! there are some mistakes in the reply I have posted. I will just explain the sequence of steps that are taking place.
1.First the message is prepared on windows machine and using the application program it is put on remote queue on windows machine configured for Mainframe.
2.On Mainframe machine the machine is received using a application program and again it is put on the remote queue configured for windows server.
3.On the receiving windows machine again the message is retrieved using an application porgram.
Observations:The message on the receiving windows machined is retrieved as it is except for the new line character which is appearing as ?
Thanks and regards
naylak |
|
Back to top |
|
 |
mrlinux |
Posted: Fri Oct 17, 2003 7:46 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
So Iam still trying to get the picture, There is no mainframe application touching the message, it is just be passed through the mainframe using MQSeries ???? _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
naylak |
Posted: Fri Oct 17, 2003 7:55 am Post subject: |
|
|
Apprentice
Joined: 08 Feb 2003 Posts: 47
|
As explained in the step 2 of my earlier reply an application porgram on mainframe acces the message from the queue and puts the message on a remote queue on mainframe configured for windows machine. No message modificaton is taking place.
Thanks and regards
naylak |
|
Back to top |
|
 |
mrlinux |
Posted: Fri Oct 17, 2003 8:15 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
Well when I posted my message you hadnt posted the description,
I have 2 Questions based on the that
1) What are you tring to accomplish with this application, since the mainframe app is reading one queue and writing to another queue with
no change in the data.
2) Is the mainframe program that is reading the queue doing a GET with
CONVERT option. _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
naylak |
Posted: Fri Oct 17, 2003 8:28 am Post subject: |
|
|
Apprentice
Joined: 08 Feb 2003 Posts: 47
|
The purpose of my application is as follows.
1.Perform a Security function on windows server
2.Put the Security performed message to mainframe sever.
3.On the mainframe server put the message to its destination.
By doing all these things I am avoiding security functions on mainframe server.
Thanks and Regards
naylak |
|
Back to top |
|
 |
mrlinux |
Posted: Fri Oct 17, 2003 9:35 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
Well Iam still confused by what you are trying to accomplish, I was hoping to find a better solution, but back to the problem when you see this Question mark in the message what is the hex value ???? _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
|