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 » [Solved] MQSet and MQInq. Confusing situation.

Post new topic  Reply to topic
 [Solved] MQSet and MQInq. Confusing situation. « View previous topic :: View next topic » 
Author Message
krondorl
PostPosted: Wed Feb 19, 2003 7:23 am    Post subject: [Solved] MQSet and MQInq. Confusing situation. Reply with quote

Newbie

Joined: 15 May 2002
Posts: 8

Greetings to all.

I am running a Mainframe OS390 CICS program that is attempting to do a MQSet command. Here are the displays fom the program.

OKQRCALL OPEN QUEUE : 13:57:42 - QNAME : MDO.REALTIMEREQUEST.QUEUE
OKQRCALL INQUIRY QUEUE : 13:57:42 - CONTROL : ON
OKQRCALL SET QUEUE : 13:57:42 - SUCCESSFULL
OKQRCALL INQUIRY QUEUE : 13:57:42 - CONTROL : ON
OKQRCALL CLOSE QUEUE : 13:57:42 - QNAME : MDO.REALTIMEREQUEST.QUEUE

Now the problem is, is that the MQSet is not changing the MQIA-TRIGGER-CONTROL to OFF as requested but is telling me it successfully updated the trigger control. Can someone help me in figuring out what is missing? If you need a copy of my MQSet code I can furnish that at a moments notice.

Thanks in advance for any help.

Glen.


Last edited by krondorl on Thu Mar 20, 2003 10:45 am; edited 1 time in total
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Wed Feb 19, 2003 4:51 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

I think you will have to post your code. Those displays give us nothing to go on.

Setting that attribute via the MQSET call is supported on your platform, so maybe there is an error in the code.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
krondorl
PostPosted: Fri Mar 07, 2003 6:01 am    Post subject: Reply with quote

Newbie

Joined: 15 May 2002
Posts: 8

Hi Peter, sorry for the delay on the code. I was away for the last 2 weeks on medical leave due to an operation.

Here is the cobol CICS code extract.

01 WSMQ-HOLDERS.
05 WSMQ-HCONN PIC S9(9) BINARY.
05 WSMQ-COMP-CODE PIC S9(9) BINARY.
05 WSMQ-COMP-CODE-D PIC S9(9).
05 WSMQ-REASON PIC S9(9) BINARY.
05 WSMQ-REASON-D PIC S9(9).
05 WSMQ-OPTIONS PIC S9(9) BINARY.
05 WSMQ-GQ-HANDLE PIC S9(9) BINARY.
05 WSMQ-PQ-HANDLE PIC S9(9) BINARY.
05 WSMQ-OPEN-CODE PIC S9(9) BINARY.
05 WSMQ-WAIT-INTVL PIC S9(6) BINARY VALUE +10.
* WAIT = ((### / 1000 = SECONDS) / 60 = MINS) / 60 = HOURS
05 WSMQ-DATA-LENGTH PIC S9(9) BINARY.
05 WSMQ-HOBJ-RESPONSE PIC S9(9) BINARY.
05 WSMQ-SELECTORCOUNT PIC S9(9) BINARY VALUE 1.
05 WSMQ-SELECTORS PIC S9(9) BINARY.
05 WSMQ-INTATTRCOUNT PIC S9(9) BINARY VALUE 1.
05 WSMQ-INTATTRS PIC S9(9) BINARY.
05 WSMQ-CHARATTRLENGTH PIC S9(9) BINARY VALUE ZERO.
05 WSMQ-CHARATTRS PIC X VALUE LOW-VALUES.

MAINLINE CODE STARTES HERE...

IF WS-NO-ERROR
MOVE MQTC-OFF TO WSMQ-INTATTRS
PERFORM 50000-RESET-TRIGGER-CNTL
END-IF.

IF WS-NO-ERROR
PERFORM 20000-PROCESS-TRIGGER
UNTIL WS-TIMEOUT
END-IF.

IF WS-NO-ERROR
MOVE MQTC-ON TO WSMQ-INTATTRS
PERFORM 50000-RESET-TRIGGER-CNTL
END-IF.

******************************************************************
* *
* RESET THE TRIGGER TO ALLOW NEW TRANSACTIONS TO RUN *
* *
******************************************************************
50000-RESET-TRIGGER-CNTL.

PERFORM 51000-OPEN-QUEUE.

IF WS-NO-ERROR
PERFORM 52000-QUEUE-INQ

IF WS-NO-ERROR
PERFORM 53000-QUEUE-SET

IF WS-NO-ERROR
PERFORM 52000-QUEUE-INQ

IF WS-NO-ERROR
PERFORM 23000-CLOSE-QUEUE
END-IF
END-IF
END-IF
END-IF.
/
******************************************************************
* *
* OPEN THE QUEUE *
* *
* -------------------------------------------------------------- *
* *
* *
******************************************************************
51000-OPEN-QUEUE.

MOVE MQTMC-QNAME TO MQOD-OBJECTNAME.
ADD MQOO-INQUIRE MQOO-SET GIVING WSMQ-OPTIONS.
MOVE SPACES TO MSG-LINE-TABLE.

STRING 'OKQRCALL OPEN QUEUE : ' WS-TIME-X
' - QNAME : ' MQOD-OBJECTNAME
DELIMITED BY SIZE
INTO MSG-LINE (1)
END-STRING.

PERFORM 88888-WRITE-TO-CSMT
VARYING MESSAGE-INDEX FROM 1 BY 1
UNTIL MESSAGE-INDEX > 1.

CALL 'MQOPEN' USING WSMQ-HCONN
OBJECT-DESCRIPTOR
WSMQ-OPTIONS
WSMQ-GQ-HANDLE
WSMQ-OPEN-CODE
WSMQ-REASON.

IF WSMQ-REASON NOT = MQRC-NONE
MOVE SPACES TO MSG-LINE-TABLE
MOVE WSMQ-REASON TO WSMQ-REASON-D

STRING 'OKQRCALL OPEN QUEUE : ' WS-TIME-X
' - REASON : ' WSMQ-REASON-D
DELIMITED BY SIZE
INTO MSG-LINE (1)
END-STRING

PERFORM 88888-WRITE-TO-CSMT
VARYING MESSAGE-INDEX FROM 1 BY 1
UNTIL MESSAGE-INDEX > 1
END-IF.
/
******************************************************************
* *
* RUN AN INQUIRY ON THE REQUEST QUEUE *
* *
* -------------------------------------------------------------- *
* *
* *
******************************************************************
52000-QUEUE-INQ.

MOVE MQIA-TRIGGER-CONTROL TO WSMQ-SELECTORS.

CALL 'MQINQ' USING WSMQ-HCONN
WSMQ-GQ-HANDLE
WSMQ-SELECTORCOUNT
WSMQ-SELECTORS
WSMQ-INTATTRCOUNT
WSMQ-INTATTRS
WSMQ-CHARATTRLENGTH
WSMQ-CHARATTRS
WSMQ-COMP-CODE
WSMQ-REASON.

IF WSMQ-REASON NOT = MQRC-NONE
MOVE WSMQ-REASON TO WSMQ-REASON-D
MOVE SPACES TO MSG-LINE-TABLE

STRING 'OKQRCALL INQUIRY QUEUE : ' WS-TIME-X
' - REASON : ' WSMQ-REASON-D
DELIMITED BY SIZE
INTO MSG-LINE (1)
END-STRING

PERFORM 88888-WRITE-TO-CSMT
VARYING MESSAGE-INDEX FROM 1 BY 1
UNTIL MESSAGE-INDEX > 1
ELSE
MOVE SPACES TO MSG-LINE-TABLE

IF WSMQ-INTATTRS = MQTC-ON
STRING 'OKQRCALL INQUIRY QUEUE : ' WS-TIME-X
' - CONTROL : ON'
DELIMITED BY SIZE
INTO MSG-LINE (1)
END-STRING
ELSE
STRING 'OKQRCALL INQUIRY QUEUE : ' WS-TIME-X
' - CONTROL : OFF'
DELIMITED BY SIZE
INTO MSG-LINE (1)
END-STRING
END-IF

PERFORM 88888-WRITE-TO-CSMT
VARYING MESSAGE-INDEX FROM 1 BY 1
UNTIL MESSAGE-INDEX > 1
END-IF.
/
******************************************************************
* *
* RUN REQUEST QUEUE TRIGGER CONTROL SET *
* *
* -------------------------------------------------------------- *
* *
* *
******************************************************************
53000-QUEUE-SET.

MOVE MQIA-TRIGGER-CONTROL TO WSMQ-SELECTORS.

CALL 'MQSET' USING WSMQ-HCONN
WSMQ-GQ-HANDLE
WSMQ-SELECTORCOUNT
WSMQ-SELECTORS
WSMQ-INTATTRCOUNT
WSMQ-INTATTRS
WSMQ-CHARATTRLENGTH
WSMQ-CHARATTRS
WSMQ-COMP-CODE
WSMQ-REASON.

IF WSMQ-REASON NOT = MQRC-NONE
MOVE WSMQ-REASON TO WSMQ-REASON-D
MOVE SPACES TO MSG-LINE-TABLE

STRING 'OKQRCALL SET QUEUE : ' WS-TIME-X
' - REASON : ' WSMQ-REASON-D
DELIMITED BY SIZE
INTO MSG-LINE (1)
END-STRING

PERFORM 88888-WRITE-TO-CSMT
VARYING MESSAGE-INDEX FROM 1 BY 1
UNTIL MESSAGE-INDEX > 1
ELSE
MOVE SPACES TO MSG-LINE-TABLE

STRING 'OKQRCALL SET QUEUE : ' WS-TIME-X
' - SUCCESSFULL'
DELIMITED BY SIZE
INTO MSG-LINE (1)
END-STRING

PERFORM 88888-WRITE-TO-CSMT
VARYING MESSAGE-INDEX FROM 1 BY 1
UNTIL MESSAGE-INDEX > 1
END-IF.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Fri Mar 07, 2003 11:31 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Code:

53000-QUEUE-SET.

MOVE MQIA-TRIGGER-CONTROL TO WSMQ-SELECTORS.

CALL 'MQSET' USING WSMQ-HCONN
WSMQ-GQ-HANDLE
WSMQ-SELECTORCOUNT
WSMQ-SELECTORS
WSMQ-INTATTRCOUNT
WSMQ-INTATTRS
WSMQ-CHARATTRLENGTH
WSMQ-CHARATTRS
WSMQ-COMP-CODE
WSMQ-REASON.

IF WSMQ-REASON NOT = MQRC-NONE
MOVE WSMQ-REASON TO WSMQ-REASON-D
MOVE SPACES TO MSG-LINE-TABLE

STRING 'OKQRCALL SET QUEUE : ' WS-TIME-X
' - REASON : ' WSMQ-REASON-D
DELIMITED BY SIZE
INTO MSG-LINE (1)
END-STRING

PERFORM 88888-WRITE-TO-CSMT
VARYING MESSAGE-INDEX FROM 1 BY 1
UNTIL MESSAGE-INDEX > 1
ELSE
MOVE SPACES TO MSG-LINE-TABLE

STRING 'OKQRCALL SET QUEUE : ' WS-TIME-X
' - SUCCESSFULL'
DELIMITED BY SIZE
INTO MSG-LINE (1)
END-STRING

PERFORM 88888-WRITE-TO-CSMT
VARYING MESSAGE-INDEX FROM 1 BY 1
UNTIL MESSAGE-INDEX > 1
END-IF.


I think you are falling into your IF, i.e. the set call is failing. The reason you think it is working is because your display statement displays WSMQ-REASON-D , but the reason code being returned by the MQSET call is WSMQ-REASON.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
krondorl
PostPosted: Fri Mar 07, 2003 11:39 am    Post subject: Reply with quote

Newbie

Joined: 15 May 2002
Posts: 8

>>I think you are falling into your IF, i.e. the set call is failing. The reason you think it is working is because your display statement displays WSMQ-REASON-D , but the reason code being returned by the MQSET call is WSMQ-REASON.

Actually if you look at the IF statement you'll see I use the WSMQ-REASON and them move that field to the -D field for display purposes only.

Kron
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Fri Mar 07, 2003 11:46 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Duh.


Back to the drawing board.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
krondorl
PostPosted: Fri Mar 14, 2003 4:43 am    Post subject: Reply with quote

Newbie

Joined: 15 May 2002
Posts: 8

The technical support people in out company have been looking it over also and can't seem to find any reason as to why it doesn't work. We might end up having to go to IBM and bring in a tech advisor to help us.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Fri Mar 14, 2003 5:00 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

What if you try using your code exactly as above, but try using the MQSET to set another attribute besides turning triggering on. Maybe that would tell us that there is a problem with the MQSET code in general, or just MQSET with turning triggering on?

(Sorry, real busy lately here. Otherwise I would take your code and try and run it here to debug)
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
kevinf2349
PostPosted: Fri Mar 14, 2003 5:48 am    Post subject: Reply with quote

Grand Master

Joined: 28 Feb 2003
Posts: 1311
Location: USA

OK....I am not a COBOL programmer...BUT.....

Don't you have to give the MQSET call a value to set the trigger control to?

Code:
53000-QUEUE-SET.

MOVE MQIA-TRIGGER-CONTROL TO WSMQ-SELECTORS.

CALL 'MQSET' USING WSMQ-HCONN
WSMQ-GQ-HANDLE
WSMQ-SELECTORCOUNT
WSMQ-SELECTORS
WSMQ-INTATTRCOUNT
WSMQ-INTATTRS
WSMQ-CHARATTRLENGTH
WSMQ-CHARATTRS
WSMQ-COMP-CODE
WSMQ-REASON.

It appears that you are telling MQSET to set Trigger-control, but not what to set it to. Wouldn't you need to specify MQTC-ON in the ATTR fields?

Of course I may be way off beam here as I usually write in assembler and you may sey this field elsewhere.
Back to top
View user's profile Send private message
krondorl
PostPosted: Thu Mar 20, 2003 10:45 am    Post subject: Reply with quote

Newbie

Joined: 15 May 2002
Posts: 8

Kevin, thanks for that insight, but if you look atthe begining of the code

IF WS-NO-ERROR
MOVE MQTC-ON TO WSMQ-INTATTRS
PERFORM 50000-RESET-TRIGGER-CNTL
END-IF.

I am setting the intattrs for the trigger-control.

Truth be told, there was a work around that did not require the use of the MQSET function. We are now considered solved on the issue that we had attempted to rectify with the MQSET function.

Thanks for all your help.
Back to top
View user's profile Send private message
mqonnet
PostPosted: Sun Mar 23, 2003 1:06 pm    Post subject: Reply with quote

Grand Master

Joined: 18 Feb 2002
Posts: 1114
Location: Boston, Ma, Usa.

Krondorl,
Kevin was right in pointing out the error. But the error was not mentioned.

You are moving in MOVE MQTC-ON TO WSMQ-INTATTRS fine. But at the wrong place. let me explain...

you issue
MOVE MQTC-ON TO WSMQ-INTATTRS followed by
PERFORM 50000-RESET-TRIGGER-CNTL. Here i assume that you wish to Turn ON the triggering. And that it is currently turned OFF.

When you are in the subroutine 50000-RESET-TRIGGER-CNTL, the value of MQTC-ON goes in. Now you call OPEN-QUEUE, and then QUEUE-INQ. At this point the INQ retrieves the latest trigger state which is OFF(from the previous assumption).
This is the Bug in your code.
You dont SET the value that you wish to propogate. And hence, you just pass in the value returned by INQ as is to SET. And hence the call to set is made with MQTC-OFF.

This is the reason you are not noticing any change in either states. If your queue is set to trigger and you run this app. It says it completed fine. But never changed it to NOTRIGGER. And vice versa.

You have 2 choices.
1) Move the statement
MOVE MQTC-ON TO WSMQ-INTATTRS to be between
IF WS-NO-ERROR
PERFORM 52000-QUEUE-INQ

IF WS-NO-ERROR
PERFORM 53000-QUEUE-SET

2) Or always the safest while using INQ and SET in the same app is to use 2 sets of variables for each one of them. That way you are sure that the values of one is not mistakenly propogated to the other, as in this case. What i mean by 2 sets is,
WSMQ-GQ-HANDLE
WSMQ-SELECTORCOUNT
WSMQ-SELECTORS
WSMQ-INTATTRCOUNT
WSMQ-INTATTRS
WSMQ-CHARATTRLENGTH
WSMQ-CHARATTRS
WSMQ-COMP-CODE
WSMQ-REASON.

All the above for say INQ.

WSMQ-GQ-HANDLE-SET
WSMQ-SELECTORCOUNT-SET
WSMQ-SELECTORS-SET
WSMQ-INTATTRCOUNT-SET
WSMQ-INTATTRS-SET
WSMQ-CHARATTRLENGTH-SET
WSMQ-CHARATTRS-SET
WSMQ-COMP-CODE-SET
WSMQ-REASON-SET

And the above for SET.

Hope this helps.

Cheers
Kumar
_________________
IBM Certified WebSphere MQ V5.3 Developer
IBM Certified WebSphere MQ V5.3 Solution Designer
IBM Certified WebSphere MQ V5.3 System Administrator
Back to top
View user's profile Send private message Send e-mail Visit poster's website
krondorl
PostPosted: Mon Mar 24, 2003 6:16 am    Post subject: Reply with quote

Newbie

Joined: 15 May 2002
Posts: 8

mqonnet. Ah, I see it now. DOH!! Thanks for that explanation. It made sense to me now.

I'll remember that for next time I try something like this. I re-coded the whole thing and removed the MQSET and MQINQ. Works as it should.
The original problem was that there were multiple cics transactions running when only one should be triggered. What was happeneing was:
open queue, get queue, close queue, process data, open reply queue, put queue, close queue. The first close emptied the queue causing the next record on the queue to trigger the application while the first was still running.

We re-coded to: open queue, open reply queue, (get queue, process data, put reply queue, syncpoint) repeat until queue empty no wait, close queue, close reply queue.
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 » [Solved] MQSet and MQInq. Confusing situation.
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.