|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
EBCDIC to ASCII |
« View previous topic :: View next topic » |
Author |
Message
|
megani |
Posted: Tue Jun 03, 2003 9:54 am Post subject: EBCDIC to ASCII |
|
|
Apprentice
Joined: 19 Dec 2001 Posts: 27
|
Hello, I'm using WMQI 2.1. I am try to take an EBCDIC blob from the mainframe and cast it to ASCII.
I have been using the statement
Set OutputRoot.XML.Message.COmmand = CAST (InputRoot.BLOB.BLOB as CHAR CCSID 437).
This is taking the X'40' ebcdic spaces and converting to @ signs. The @ sign is X'40' in ASCII, but I want it to be X'20' spaces in ASCII. I'd appreciate any input on this.
Thank you |
|
Back to top |
|
 |
shalabh1976 |
Posted: Tue Jun 03, 2003 11:50 am Post subject: |
|
|
 Partisan
Joined: 18 Jul 2002 Posts: 381 Location: Gurgaon, India
|
I don't know your exact environment but I'll describe mine:
The Broker is on S390 and the data returned is in EBCDIC but we want to view the output in ASCII (as it should be readable).
So in the input queue itself we specify the Encoding to 546 and CCSID to 437 and it works fine.
Actually the bitstream itself will remain unchanged so if you want to convert X'40' to X'20' then you must code it.
Last edited by shalabh1976 on Wed Jun 04, 2003 4:26 am; edited 1 time in total |
|
Back to top |
|
 |
kirani |
Posted: Tue Jun 03, 2003 4:34 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
well .. you are missing 2 lines of code here ...
Code: |
SET OutputRoot.Properties.CodedCharSetId = 437;
SET OutputRoot.Properties.Encoding = 546;
|
_________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
warrenpage |
Posted: Tue Jun 03, 2003 8:38 pm Post subject: Cant convert blobs inside WMQI |
|
|
Acolyte
Joined: 19 Feb 2002 Posts: 56 Location: Australia
|
I had the same problem. You can do conversions
1. At the input queue - if the MQFMT = MQSTR, then you can have the input converted to Ascii there.. Look at the parameters in the input node.
2. Writing MRM/XML to an output queue - as per Kiranis note above - if you specify a Char set it will convert the current data into that Charset.
I could never get it to work for BLOBS.
I ended up writing my own Java node to do this for BLOBS. using some code like this
public static void convertetoa (InputStream in, OutputStream out) {
try {
//output file in ebcdic from unicode
InputStreamReader inputReader = new InputStreamReader(in,"Cp500");
OutputStreamWriter outWriter = new OutputStreamWriter(out,"Cp1252");
int c;
while ((c = inputReader.read()) >= 0)
outWriter.write(c);
inputReader.close();
outWriter.close();
}
catch (Exception e) { e.printStackTrace(); }
} |
|
Back to top |
|
 |
shalabh1976 |
Posted: Wed Jun 04, 2003 4:40 pm Post subject: |
|
|
 Partisan
Joined: 18 Jul 2002 Posts: 381 Location: Gurgaon, India
|
Warren,
My Input is in BLOB and the output is in XML (EBCDIC to ASCII)
and using the convert options on the MQinput node to 437 and 546 for encoding worked for me. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|