ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » EBCIDIC signed data to ASCII

Post new topic  Reply to topic Goto page 1, 2  Next
 EBCIDIC signed data to ASCII « View previous topic :: View next topic » 
Author Message
sagwa99
PostPosted: Tue Aug 20, 2002 6:48 pm    Post subject: EBCIDIC signed data to ASCII Reply with quote

Novice

Joined: 14 Jun 2002
Posts: 15

I like to convert EBCDIC signed data to ASCII numeric with a '-' sign if the number is negative.

Please help.
Back to top
View user's profile Send private message
kirani
PostPosted: Tue Aug 20, 2002 8:20 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Is it a packed decimal field?
_________________
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
View user's profile Send private message Visit poster's website
sagwa99
PostPosted: Wed Aug 21, 2002 5:45 am    Post subject: Reply with quote

Novice

Joined: 14 Jun 2002
Posts: 15

In fact, there are two sets of data, one is packed and the other is unpacked on different projects.

Appreciate help for both requirements.

Thanks.
Back to top
View user's profile Send private message
kirani
PostPosted: Wed Aug 21, 2002 6:34 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

You could do this by define these fields into MRM MessageSet and WMQI will take care of data conversion for you.
Chapter 9 in Working with Messages manual lists mapping table for COBOL/C data type, MRM Physical and Logical Type.
_________________
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
View user's profile Send private message Visit poster's website
sagwa99
PostPosted: Wed Aug 21, 2002 5:37 pm    Post subject: Reply with quote

Novice

Joined: 14 Jun 2002
Posts: 15

I could not find the recommended manual "Working with Messages".

However below was my attempt:
singned data (unpacked) from an EBCDIC machine to be converted to ASCII numeric with a '-' sign.

Input

signed === dataValue === Hex value
00123L === -001233 === 30303132334C

The message set (MRM) definition
logical type is float

CWF properties
physical type = extended decimal
Length Count = 7
Signed = Yes
Sign Orientation = separate trailing

Have input parsing error, thanks for any help.
Back to top
View user's profile Send private message
kirani
PostPosted: Wed Aug 21, 2002 6:52 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

What is your pic clause for this field? Looking at your value (-001233) I think, your length count should be set to 6.
Could you print your ExceptionList here?

You can download Working with Messages manual from following url,
http://www-3.ibm.com/software/ts/mqseries/library/manualsa/manuals/wsmqsiv21.html
_________________
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
View user's profile Send private message Visit poster's website
sagwa99
PostPosted: Wed Aug 21, 2002 7:16 pm    Post subject: Reply with quote

Novice

Joined: 14 Jun 2002
Posts: 15

I am using v2.0.1. The manual you referred to is for v2.1.

Can v2.0.1 handle this situation?

Thanks.
Back to top
View user's profile Send private message
kirani
PostPosted: Wed Aug 21, 2002 7:20 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Yes, MQSI V2.x.x can handle this. IBM has rearranged these books in WMQI 2.1 version.
In MQSI 2.0.1 you should refer to Using Control Center (Appendix B) manual.

MQ Related manuals link:
http://www-3.ibm.com/software/ts/mqseries/library/manualsa/
_________________
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
View user's profile Send private message Visit poster's website
sagwa99
PostPosted: Wed Aug 21, 2002 7:37 pm    Post subject: Reply with quote

Novice

Joined: 14 Jun 2002
Posts: 15

Yes I am refering to "Using the Control Center".

I do not know the pic clause. Refering to page 290 of "Using the Control Center", I interpreted 00123L as sign trailing seperate. May be I have misundestood the pic clause, could you please explain.

Thanks.
Back to top
View user's profile Send private message
warrenpage
PostPosted: Thu Aug 22, 2002 11:00 am    Post subject: MRM or CHEAT Reply with quote

Acolyte

Joined: 19 Feb 2002
Posts: 56
Location: Australia

I assume you are talking about

PIC S9 type fields

They aren't packed but OS/390 used the high order 4 bits of the last digit to store the sign. This morphs the last digit from a numeric character to something else.

Obviously you could define the field using MRM and get it to interpret it.

One other way we use is by translating the morphed character back to the right digit and identifying the appropriate sign for it. We simple convert all the EBCDIC to ASCII, then convert the morphs ASCII char back to a digit.

We do this in java but you could do it in ESQL I guess.

The Array below shows the morphed last digit character, its sign, and the actual digit is should be

{'{', '+', '0'},
{'A', '+', '1'},
{'B', '+', '2'},
{'C', '+', '3'},
{'D', '+', '4'},
{'E', '+', '5'},
{'F', '+', '6'},
{'G', '+', '7'},
{'H', '+', '8'},
{'I', '+', '9'},
{'}', '-', '0'},
{'J', '-', '1'},
{'K', '-', '2'},
{'L', '-', '3'},
{'M', '-', '4'},
{'N', '-', '5'},
{'O', '-', '6'},
{'P', '-', '7'},
{'Q', '-', '8'},
{'R', '-', '9'}

SO

12{ is actually +120
12A is actually +121
12B is actually +122
12C is actually +123

12} is actually -120
12J is actually -121
12K is actually -122
12L is actually -123
12M is actually -124

e.t.c
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
sagwa99
PostPosted: Thu Aug 22, 2002 7:43 pm    Post subject: Reply with quote

Novice

Joined: 14 Jun 2002
Posts: 15

Hi All,

Thanks a lot for further explanation. Is there a way to parse this type of field using MRM.

I tried the following but having parsing error (invalid extended decimal):

input value = 00123L

logical type = integer
CWF
physical type = extended decimal
Length count = 7
Signed = Yes
Sign Orientation = Separte Trailing

What's wrong with it? Thansk in advance.
Back to top
View user's profile Send private message
kirani
PostPosted: Thu Feb 20, 2003 10:18 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

This was a bug in WMQI. We received an e-fix, which solved this problem.
Now WMQI can parse all those morphed last digit characters.
_________________
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
View user's profile Send private message Visit poster's website
jfluitsm
PostPosted: Mon Feb 24, 2003 6:18 am    Post subject: Reply with quote

Disciple

Joined: 24 Feb 2002
Posts: 160
Location: The Netherlands

In your MRM definition you state sign Orientation = Separate Trailing while you provide an embeded sign, so this should be Included Trailing.
You can also change the cobol definition to S9(5) SIGN TRAILING SEPARATE.
The lenght count should include 1 byte for the sign when you use Separate.
_________________
Jan Fluitsma

IBM Certified Solution Designer WebSphere MQ V6
IBM Certified Solution Developer WebSphere Message Broker V6
Back to top
View user's profile Send private message Send e-mail
lillo
PostPosted: Wed Nov 19, 2003 1:47 am    Post subject: Reply with quote

Master

Joined: 11 Sep 2001
Posts: 224

kirani wrote:
This was a bug in WMQI. We received an e-fix, which solved this problem.
Now WMQI can parse all those morphed last digit characters.


Is that e-fix included in any CSD? If the efix is included how could I do that transformation?

I had a similar problem and I think is related with this issue. I have a PIC S9(3) element whick I defined as decimal (also tried as integer), Extended Decimal, Lengh Count=3, and Signed Yes. When I receive from host I get 0x303041 (00A in ASCII), which should be 1, or 0x30307B (00{) in ASCII, which should be +0.

Any idea how to solve this?

TIA
_________________
Lillo
IBM Certified Specialist - WebSphere MQ
Back to top
View user's profile Send private message
jfluitsm
PostPosted: Wed Nov 19, 2003 2:48 pm    Post subject: Reply with quote

Disciple

Joined: 24 Feb 2002
Posts: 160
Location: The Netherlands

Oh yeah, no problem.

+1 in PIC S9(3) will result on the host in 0xF0F0C1, which interpret as EBCDIC is 00A, but this is no EBCDIC, this is a numeric encoding.
On your (ASCII) broker, this part should also read 0xF0F0C1, or probably 0x3030C1 would also be ok.

Somewhere between your host application and the broker there was a EBCDIC/ASCII conversion.

You can try the following:
- Check all the places where a queue is read for the convert option, this should be off or not set, most likely this is set in your MQInput node.
- When using embeded signs, treat the message in MQ (not MQSI) as BLOB by setting MQMD.Format to MQFMT_NONE, this will prevent any MQ conversion to take place.
- As I mentioned earlier, use SIGN SEPERATE TRAILING, instead of 00A you get 001+, this can be translated from EBCDIC to ASCII.

Remeber, the broker always convert to UCS-2 for internal use, so if your message is still in EBCDIC (both CCSID and the contents) when arrived in the borker, the MRM parser will translate the message correctly, that is it will translate string fields from EBCDIC to UCS-2 and it will interpret the numeric field to the correct integer value.
_________________
Jan Fluitsma

IBM Certified Solution Designer WebSphere MQ V6
IBM Certified Solution Developer WebSphere Message Broker V6
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » EBCIDIC signed data to ASCII
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.