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 » IBM MQ API Support » unsigned char for useEmptyBuffer & useFullBuffer

Post new topic  Reply to topic
 unsigned char for useEmptyBuffer & useFullBuffer « View previous topic :: View next topic » 
Author Message
alperb
PostPosted: Wed Mar 16, 2005 10:52 am    Post subject: unsigned char for useEmptyBuffer & useFullBuffer Reply with quote

Apprentice

Joined: 01 Jun 2004
Posts: 25

being a newbie I have some questions
I am trying to put and get some message however message is type of byte.
I got some examples but they all use string format and the useemptybuffer takes const char as first parameter.
how can I put and get byte to MQ?

Also when talking to a mainframe do I have to explicitly do conversion ASCII-EBCDIC or is there a better way of doing so?

thanks is advance

Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Mar 16, 2005 1:10 pm    Post subject: Reply with quote

Grand High Poobah

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

Quote:
Also when talking to a mainframe do I have to explicitly do conversion ASCII-EBCDIC or is there a better way of doing so?

There is a better way for doing so providing the totality of your message payload is text.

Set MQMD format to MQSTR (see constants / programmer manual)
When retrieving the message use the getoption WithConvert ...

Sorry if the terms are not exact... looks like my memory is shot today.
Enjoy
Back to top
View user's profile Send private message Send e-mail
bower5932
PostPosted: Wed Mar 16, 2005 1:12 pm    Post subject: Re: unsigned char for useEmptyBuffer & useFullBuffer Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

alperb wrote:
Also when talking to a mainframe do I have to explicitly do conversion ASCII-EBCDIC or is there a better way of doing so?


If the format of your message is MQSTR, then the WMQ can do the conversion for you.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
jefflowrey
PostPosted: Wed Mar 16, 2005 1:17 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

First you want to put raw bytes to the message, not characters.

Then you want those bytes to be treated as characters, and converted from one character set to another.

I'm confused.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
alperb
PostPosted: Thu Mar 17, 2005 12:37 am    Post subject: bytes not chars Reply with quote

Apprentice

Joined: 01 Jun 2004
Posts: 25

In fact I am trying to to put raw bytes to the message not characters what MQSTR doesn't do.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Mar 17, 2005 4:26 am    Post subject: Reply with quote

Grand High Poobah

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

Then you will have to write your own conversion in a message exit on the channel.

Have fun as there is no way to know what format the different message types passing through the channel will have and you need to handle them all.

Create a new copy book with all fields as text especially numbers and use MQSTR. Conversion is automatic you'll be much better off.

Enjoy
Back to top
View user's profile Send private message Send e-mail
alperb
PostPosted: Thu Mar 17, 2005 5:13 am    Post subject: Reply with quote

Apprentice

Joined: 01 Jun 2004
Posts: 25

thanks.
then what is the format for raw bytes while putting and getting from queue?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Mar 17, 2005 5:22 am    Post subject: Re: bytes not chars Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

alperb wrote:
In fact I am trying to to put raw bytes to the message not characters what MQSTR doesn't do.


Then you don't care if the raw bytes get converted to EBCDIC, and in fact that would probably be bad - as they would now be different bytes.

What language are you using, anyway? C? C++?

Are you aware that C treats char and byte as the same thing? So an array of chars is the same as an array of bytes, unless you pass it to functions that treat that array as String data (like strcpy)...
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
bower5932
PostPosted: Thu Mar 17, 2005 7:56 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

fjb_saper wrote:
Then you will have to write your own conversion in a message exit on the channel.


Couldn't you use your own user-defined message format for each type of message? You could then have a data-conversion exit called during the MQGET to convert the data. There are details in the Application Programming Guide.

However, I'm still a big believer that you need to consider sending nothing but text data and use MQSTR as your format.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
alperb
PostPosted: Thu Mar 17, 2005 2:12 pm    Post subject: Reply with quote

Apprentice

Joined: 01 Jun 2004
Posts: 25

In fact I am using use c++. What makes me curious is if MQSTR is OK with bytes (unsigned char) then why examples use the useemptybuffer which takes const char as first parameter?
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 » IBM MQ API Support » unsigned char for useEmptyBuffer & useFullBuffer
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.