|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
|
|
send msg from as400 to mainframe, but error with bad format |
« View previous topic :: View next topic » |
Author |
Message
|
mq newguy |
Posted: Wed Jun 26, 2002 11:21 am Post subject: send msg from as400 to mainframe, but error with bad format |
|
|
Newbie
Joined: 21 Jun 2002 Posts: 8
|
Im wondering that they cant read the data due to a bad format because I have specified MQPMO_SYNCPOINT, but I didnt set MD.Format = MQFMT_STRING. the program over on the mainframe has a convert option, why would we need that whe they are both EBCIDIC.???
here is a snippet from the MQ code C on the as400. thanks everyone
Code: |
MQLONG PutMessage(INT ToQueue)
{
/*****Put Message Options Structure*****/
memset(&PutMsgOpts, '\0', sizeof(MsgDesc));
memcpy(PutMsgOpts.StrucId, MQPMO_STRUC_ID,
sizeof(PutMsgOpts.StrucId));
PutMsgOpts.Version = MQPMO_VERSION_1;
PutMsgOpts.Version = MQPMO_SYNCPOINT; /* ????? should this be NO_SYNCPOINT??*/
/*****Message Descriptor Structure*****/
memset(&MsgDesc, '\0', sizeof(MsgDesc));
memcpy(MsgDesc.StrucId, MQMD_STRUC_ID,
sizeof(MsgDesc.StrucId));
MsgDesc.Version = MQMD_VERSION_1;
MsgDesc.Expiry = MQEI_UNLIMITED;
MsgDesc.Report = MQRO_NONE;
MsgDesc.MsgType = MQMT_DATAGRAM;
MsgDesc.Priority = 1;
MsgDesc.Persistence = MQPER_PERSISTENT;
/* ???????MsgDesc.Format = MQFMT_STRING; */
memset(MsgDesc.ReplyToQ, '\0', sizeof(MsgDesc.ReplyToQ));
if (ToQueue)
{
MQPUT( Hcon, /* connection handle */
Hobj3, /* object handle */
&MsgDesc, /* message descriptor */
&PutMsgOpts, /* default options (datagram) */
sizeof(message_buffer),
message_buffer,
&iCompCode, /* completion code */
&iReason ); /* reason code */
}
else...... |
|
|
Back to top |
|
|
mrlinux |
Posted: Wed Jun 26, 2002 7:51 pm Post subject: |
|
|
Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
This line
PutMsgOpts.Version = MQPMO_SYNCPOINT; /* ????? should this be NO_SYNCPOINT??*/
should be
PutMsgOpts.Options = MQPMO_SYNCPOINT
also suggest you change
memset(&PutMsgOpts, '\0', sizeof(MsgDesc));
memcpy(PutMsgOpts.StrucId, MQPMO_STRUC_ID,
sizeof(PutMsgOpts.StrucId));
to this
MQPMO PutMsgOpts = {MQPMO_DEFAULT}; _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
|
mq newguy |
Posted: Mon Jul 01, 2002 8:51 am Post subject: |
|
|
Newbie
Joined: 21 Jun 2002 Posts: 8
|
I had this in my declaration
/* MQ Variables */
static CHAR QMName[MQ_Q_MGR_NAME_LENGTH];
static MQPMO PutMsgOpts = {MQPMO_DEFAULT}; <---------------
static MQGMO GetMsgOpts = {MQGMO_DEFAULT};/* Options which control
static MQBYTE Buffer[1024]; /* Area for message data */
static MQOD od = {MQOD_DEFAULT}; /* Object Descriptor */
static MQHCONN Hcon = (MQHCONN)NULL; /* connection handle */
static MQHOBJ Hobj3 = MQHO_UNUSABLE_HOBJ;/* object handle for BR */
static MQHOBJ Hobj2 = MQHO_UNUSABLE_HOBJ;/* object handle for VEC*/
static MQMD MsgDesc = {MQMD_DEFAULT}; /* Message descriptor */ |
|
Back to top |
|
|
mrlinux |
Posted: Mon Jul 01, 2002 9:17 am Post subject: |
|
|
Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
Small error
PutMsgOpts.Options |= MQPMO_SYNCPOINT; _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
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
|
|
|
|