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 » Converting integers into Packed Decimal format

Post new topic  Reply to topic
 Converting integers into Packed Decimal format « View previous topic :: View next topic » 
Author Message
dilse
PostPosted: Thu Feb 03, 2005 2:40 pm    Post subject: Converting integers into Packed Decimal format Reply with quote

Master

Joined: 24 Jun 2004
Posts: 270

Hi Guys,
I need ur help here. I am importing a COBOL copybook into my message set which contains two variables of type COMP-3. My input is coming as an XML and I need to convert it to MRM format.

05 PRSEQ PIC 9(0003) COMP-3.
05 PRSUB PIC 9(0007) COMP-3.

I am able to get integers from input XML but I am not able to convert these integers into COMP-3 variable. Output is showing some garbage characters when I assigned them as integers. How would I assign integer into packed decimal format. Any kind of input is appreciated.

Thanks,
DilSe..
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Feb 03, 2005 2:57 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Look at your integer and get its absolute value.
Transform into string and add qualifier for sign at the end ("F","C","D")
Left padd with 0 until you have the right length (remember total number of bytes for your packed number)
Add "0x" in front of it.
Use the Decode function. You should get a byte array representing your packed 3 number....

This will need working on a little bit but you get the general idea

Enjoy
Back to top
View user's profile Send private message Send e-mail
EddieA
PostPosted: Thu Feb 03, 2005 4:01 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Quote:
I am not able to convert these integers into COMP-3 variable

You shouldn't have to. If you have imported the COBOL copy book, it should have set the attributes correctly. in the MRM.

All you need do, is SET the field with the integer value.

Quote:
Output is showing some garbage characters

If you look at the data on the queue that's what it might appear, becasue it's not a human "readable" format.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
kirani
PostPosted: Fri Feb 04, 2005 12:30 am    Post subject: Reply with quote

Jedi Knight

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

Also, make sure you set correct CCSID and Encoding on your output message. Otherwise the receiving platform might have some problems when reading this message.
_________________
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
dilse
PostPosted: Fri Feb 04, 2005 6:18 am    Post subject: Reply with quote

Master

Joined: 24 Jun 2004
Posts: 270

Thanks for all the replies. I'll try to solve it.
Back to top
View user's profile Send private message
LearnMQSI
PostPosted: Sun Mar 05, 2006 7:19 pm    Post subject: Reply with quote

Centurion

Joined: 20 Aug 2002
Posts: 137

Hey Dilse,

Did you resolve your COMP-3 issue. I too have the same issue. Like you said, my input also coming from an XML but my MRM is not accepting the value in it. Actually I throw 123456789 value in one of my field, probably its taking as a string '123456789'.

I have set Physical type for this particular field is as Integer 4 but just now came to know that it has to be a Packed Decimal. I will try it and let you know in case I'm success. In the mean time if you resolved it, please let me know.

Thanks!!!
_________________
IBM Certified System Administrator - WebSphere MQ 5.3
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Converting integers into Packed Decimal format
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.