Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2018 Reason on MQOPEN

Status
Not open for further replies.

troemen

Programmer
Jan 17, 2002
2
US
I'm writing an application on Windows NT, using VisualAge COBOL and MQ V5.2. When I step thru the program I can see that the MQCONN works properly (I get zero in the completion code and reason and a valid HCONN). When I attempt to use the HCONN that I get back from the MQCONN on the MQOPEN I always get a 2018 reason back. I don't understand why I get a HCONN error when the initial connection worked properly?

Thanks!
Tim
 
Post a fragment of your code showing the MQOPEN and MQGET - are you sure you're using the correct data types etc?

Cheers,
Paul
 
All of the fields are defined as PIC S9(9) BINARY.
(I've also tried defining them as PIC S9(9) COMP-5.)
I am checking the completion and reason - I've just omitted that code here.


Here's the Connect:

MOVE MQTMC-QMGRNAME TO WS-QM-NAME-CONNECT.
MOVE MQCC-OK TO COMPLETION-CODE.
MOVE MQRC-NONE TO CON-REASON.

>>CALLINT CDECL
CALL 'MQCONN' USING WS-QM-NAME-AREA
WS-HCONN
COMPLETION-CODE
CON-REASON.
>>CALLINT SYSTEM

Here's the open:

COMPUTE WS-Q-OPEN-OPTIONS = MQOO-INPUT-SHARED
+ MQOO-INQUIRE
+ MQOO-FAIL-IF-QUIESCING.

MOVE MQOT-Q TO MQOD-OBJECTTYPE.
MOVE MQTMC-QNAME TO MQOD-OBJECTNAME.
MOVE SPACES TO MQOD-OBJECTQMGRNAME.
MOVE MQCC-OK TO OPEN-CODE.
MOVE MQRC-NONE TO REASON.

******
* CALL IBM'S PROGRAM TO OPEN THE QUEUE.
******

>>CALLINT CDECL
CALL 'MQOPEN' USING WS-HCONN
WS-Q-NAME-AREA
WS-Q-OPEN-OPTIONS
WS-HOBJ
OPEN-CODE
REASON.
>>CALLINT SYSTEM

 
Hi!

FWIW, here's a description of 2018:

Connection handle not valid.

The connection handle Hconn is not valid. This reason
also occurs if the parameter pointer is not valid, or
(for the MQCONN or MQCONNX call) points to read-only
storage. (It is not always possible to detect
parameter pointers that are not valid; if not
detected, unpredictable results occur.)

Corrective action: Ensure that a successful MQCONN or
MQCONNX call is performed for the queue manager, and
that an MQDISC call has not already been performed for
it. Ensure that the handle is being used within its
valid scope.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top