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 » General IBM MQ Support » Error while running the application program

Post new topic  Reply to topic
 Error while running the application program « View previous topic :: View next topic » 
Author Message
vandanakoleshwar
PostPosted: Sun Feb 08, 2004 8:05 pm    Post subject: Error while running the application program Reply with quote

Newbie

Joined: 08 Feb 2004
Posts: 8

Hi,
I had worked with MQ ver 5.1 initially. I had executed the COBOL prgrams using the Fujitsu compiler and it was working fine. I have used the file mqic32.lib while linking. Now I have installed the latest ver of MQ on windows. When I execute the same COBOL program I get a run time error. The reason code that I get is 168296448 and the comp code is 033554432. Where do I get an explanation of the reason codes and comp code? Sending the code...

*
*===============================================================
IDENTIFICATION DIVISION.
*===============================================================
*
PROGRAM-ID. MQWRITE.
*
* Module Name : MQWRITE
*
* Description : Program to process requests.
*
* Function : This program receives a request message
* and performs the "business logic"
* returns a reply message.
*
* *************************************************************
*
*===============================================================
ENVIRONMENT DIVISION.
*===============================================================
DATA DIVISION.
*===============================================================
WORKING-STORAGE SECTION.
* GENERAL WORKING-STORAGE FIELDS
*---------------------------------------------------------------
*
*
01 W01-MQM PIC X(4 VALUE 'QM2'.
01 W01-OBJECT PIC X(4 VALUE 'Q2'.
01 W01-HCONN PIC S9(9) BINARY.
01 W01-HOBJ PIC S9(9) BINARY.
01 W01-OPTIONS PIC S9(9) BINARY.
01 W01-COMPCODE PIC S9(9) BINARY.
01 W01-REASON PIC S9(9) BINARY.
01 W01-OUTPUT-BUFFER PIC X(100) VALUE 'VANDANA'.
01 W01-OUTPUT-BUFFER-LENGTH PIC S9(9) BINARY VALUE 100.

01 CLS-OPTIONS PIC S9(9) BINARY.

01 MQM-OBJECT-DESCRIPTOR.
COPY "CMQODV.CPY".

01 MQM-MESSAGE-DESCRIPTOR.
COPY "CMQMDV.CPY".

01 MQM-PUT-MESSAGE-OPTIONS.
COPY "CMQPMOV.CPY".

01 MQM-CONSTANTS.
COPY "CMQV.CPY".
*===============================================================
PROCEDURE DIVISION.
*===============================================================
*
0000-MAIN.

DISPLAY "CONNECTING TO ..... " W01-MQM.
PERFORM 1000-MQ-CONNECT THRU 1000-MQ-CONNECT-EXIT.
IF W01-COMPCODE NOT = MQCC-OK
DISPLAY "COULD NOT CONNECT " W01-REASON
DISPLAY "The compcode is " W01-COMPCODE
STOP RUN.

PERFORM 2000-MQ-OPEN THRU 2000-MQ-OPEN-EXIT.
IF W01-COMPCODE NOT = MQCC-OK
PERFORM 5000-DISCONNECT THRU 5000-DISCONNECT-EXIT.

PERFORM 3000-MQ-PUT THRU 3000-MQ-PUT-EXIT.
IF W01-COMPCODE NOT = MQCC-OK
PERFORM 5000-DISCONNECT THRU 5000-DISCONNECT-EXIT.
STOP RUN.

* -------------------------------------------------------------
* End of main logic
* -------------------------------------------------------------

1000-MQ-CONNECT.

CALL 'MQCONN' USING W01-MQM
W01-HCONN
W01-COMPCODE
W01-REASON.

1000-MQ-CONNECT-EXIT.
EXIT.

*
* Open output queue
*
2000-MQ-OPEN.

MOVE MQOT-Q TO MQOD-OBJECTTYPE.
MOVE W01-OBJECT TO MQOD-OBJECTNAME.
COMPUTE W01-OPTIONS = MQOO-OUTPUT +
MQOO-FAIL-IF-QUIESCING.
*
CALL 'MQOPEN' USING W01-HCONN
MQOD
W01-OPTIONS
W01-HOBJ
W01-COMPCODE
W01-REASON.

2000-MQ-OPEN-EXIT.
EXIT.

*
* Write a message to a queue.
*
3000-MQ-PUT.

MOVE MQMT-DATAGRAM TO MQMD-MSGTYPE.
MOVE MQCI-NONE TO MQMD-CORRELID.
MOVE MQMI-NONE TO MQMD-MSGID.
MOVE 5 TO MQMD-PRIORITY.
MOVE MQPER-NOT-PERSISTENT TO MQMD-PERSISTENCE.
COMPUTE MQPMO-OPTIONS = MQPMO-NO-SYNCPOINT +
MQPMO-DEFAULT-CONTEXT.
*
CALL 'MQPUT' USING W01-HCONN
W01-HOBJ
MQMD
MQPMO
W01-OUTPUT-BUFFER-LENGTH
W01-OUTPUT-BUFFER
W01-COMPCODE
W01-REASON.
IF W01-COMPCODE NOT = MQCC-OK
DISPLAY 'COULD NOT PUT MESSAGE'.


3000-MQ-PUT-EXIT.
EXIT.

*
* Close output queue
*
5100-MQ-CLOSE-OUT.

MOVE MQCO-NONE TO CLS-OPTIONS.
*
CALL 'MQCLOSE' USING W01-HCONN
W01-HOBJ
CLS-OPTIONS
W01-COMPCODE
W01-REASON.

5100-MQ-CLOSE-OUT-EXIT.
EXIT.

5000-DISCONNECT.
PERFORM 5100-MQ-CLOSE-OUT THRU 5100-MQ-CLOSE-OUT-EXIT.
PERFORM 5200-MQ-DISCONNECT THRU 5200-MQ-DISCONNECT-EXIT.

5000-DISCONNECT-EXIT.
EXIT.

*
* Disconnect from the queue manager
*
5200-MQ-DISCONNECT.

CALL 'MQDISC' USING W01-HCONN
W01-COMPCODE
W01-REASON.

*
5200-MQ-DISCONNECT-EXIT.
EXIT.
*




Rgds,
Vandana
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Sun Feb 08, 2004 11:03 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Hi,

Hummm, that code looks familiar.

The code runs fine for me. (Remember folks, I am not a COBOL programmer, I am not a COBOL programmer, I am not a COBOL programmer, etc...)

My guess is that you should STOP linking your program with the C libraries!!!!!!

Your choice (for COBOL) is MQMCB32.LIB (binding mode) or MQICCB32.LIB (client mode).

Hope that helps.

later
Roger Lacroix
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
vandanakoleshwar
PostPosted: Fri Feb 20, 2004 9:32 pm    Post subject: Runtime error 2058 In MQ cobol program Reply with quote

Newbie

Joined: 08 Feb 2004
Posts: 8

Hi,
Thanks for the suggestion. The compilation and linking works fine.
I have linked with MQICCb32.lib.
But after executing i get a runtime error with a reason code of 2058..
It means that the QMR name is incorrect. I get this error after MQConn.
I have created the objects thru MQ explorer, checked that the QMGR is listening on the correct port but I am not able to figure out the cause of the error. Is there anything else that I need to check?


Rgds,
Vandana
Back to top
View user's profile Send private message
vennela
PostPosted: Fri Feb 20, 2004 11:10 pm    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Are you sure about the QMGR name.

Do a dspmq on the command prompt and see if there is a QMGR with the name QM2

Did you set the MQSERVER environment variable
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vandanakoleshwar
PostPosted: Sat Feb 21, 2004 12:30 am    Post subject: Runtime error 2058 In MQ cobol program Reply with quote

Newbie

Joined: 08 Feb 2004
Posts: 8

Yes the Que manager is present. No I have not set the MQServer variable.
I have never done it when I ran the same application earlier without setting the MQSErver environment and it worked fine.


Rgds,
Vandana
Back to top
View user's profile Send private message
JasonE
PostPosted: Sat Feb 21, 2004 3:43 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

Isnt this library a client library? If so, you are issuing an MQCONN so how does it know where to go - You would either need to set up the MQSERVER or MQCHL* envirornment variables. If you are on the same machine as the server, then you want server bindings which would (I guess) be one of the mqmcb* libraries.
Back to top
View user's profile Send private message
vandanakoleshwar
PostPosted: Sat Feb 21, 2004 4:20 am    Post subject: Runtime error 2058 In MQ cobol program Reply with quote

Newbie

Joined: 08 Feb 2004
Posts: 8

Hi,
The MQ server and client component is installed on the machine.
The QMR is also present on the same machine.
Where do I get infm abt setting MQServer variable? I have tried linking with both libraries MQMCB32.LIB and MQICCB32.LIB.


Regards,
Vandana
Back to top
View user's profile Send private message
vennela
PostPosted: Sat Feb 21, 2004 10:09 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

For information on MQSERVER variable, you can look in MQSeries client manual or search in this site.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vandanakoleshwar
PostPosted: Tue Feb 24, 2004 5:01 am    Post subject: MQ download Reply with quote

Newbie

Joined: 08 Feb 2004
Posts: 8

Whr can I download the MQ sft from? trial version..

Rgds,
Vandana
Back to top
View user's profile Send private message
JasonE
PostPosted: Tue Feb 24, 2004 9:18 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

If you are on the same machine as the qmgr, there is no need to use client bindings and hence no need for MQSERVER or the MQCHL* env vars. You need to link with the mqmcb32.Lib I would guess. If you are not fixpack 5, put that on just in case it makes a difference. If it still fails, take a trace and look for the trace file for your app - when it issues the MQCONN, what qmgr name is traced?
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 » General IBM MQ Support » Error while running the application program
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.