Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

CICS - WAIT or DELAY?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
shanudarling
Warnings : 1

New User


Joined: 20 Dec 2006
Posts: 55
Location: noida

PostPosted: Tue Jan 27, 2009 12:00 pm    Post subject: CICS - WAIT or DELAY?
Reply with quote

I have to write a CICS program (A) which will call another program (B) to write data to MQ, this data will be processed at mid-tier and will be send back to mainframe via MQ. Another program (C) will read the MQ to get the processed record and will again pass the control to program A.

The solution I have thought is -
Program A will call B.
B will put the data in the MQ.
After putting the data, program B will wait for 10 seconds and then it will call program C. Program C will read the MQ, if the record is not available then it will give a time out error otherwise normal processing continues.

Does this solution looks feasible? or is there any other way of doing it?

Also the problem is that we have to implement a time-out while recieving the processed message from MQ. So, which is a better option - WAIT or DELAY.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Jan 27, 2009 12:33 pm    Post subject:
Reply with quote

Hello,

Quote:
After putting the data, program B will wait for 10 seconds and then it will call program C.
Suggest you consider a different approach - especially if this is a multi-user application.

Quote:
So, which is a better option - WAIT or DELAY.
IMHO, neither. I believe that this approach will cause long-term problems.
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 992
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Tue Jan 27, 2009 2:34 pm    Post subject:
Reply with quote

Quote:
After putting the data, program B will wait for 10 seconds and then it will call program C. Program C will read the MQ, if the record is not available then it will give a time out error otherwise normal processing continues.


The usual way to handle this type of processing is for program B to MQPUT(1) the message and then immediately call program C which will use the MQ WaitInterval in the MQGET to specify the maximum wait for the reply message. when the intervakl elapses and no reply is received, cond code 2 with reason 2033 (MQCC_FAILED with MQRC_NO_MSG_AVAILABLE ) is returned to the application. On getting this, the application performs the timeout error handling.

One advantage of doing it this way is that a reply is processed as soon as it arrives and the fixed 10sec delay is avoided.


Garry.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Jan 27, 2009 2:58 pm    Post subject:
Reply with quote

you have two processes:
  • Build and Send, log msg
  • Receive, process, log msg


They are two different tasks,
which is required,
because MsgNo2 could come back before MsgNo1,
or MsgNo1 might never be read by the receive task.

Have you also looked into RRS?
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 992
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Tue Jan 27, 2009 3:11 pm    Post subject:
Reply with quote

Quote:
They are two different tasks,


As phrased by the O/P, it first looks this way. However,
Quote:
After putting the data, program B will wait for 10 seconds and then it will call program C. Program C will read the MQ
suggests that Progam C is part of the same task.

The situation
Quote:
because MsgNo2 could come back before MsgNo1,
or MsgNo1 might never be read by the receive task.
can be handled within the task by proper use of MQ's MessageId and CorrelId settings.

I would also suggest that both request and reply messages have an expiry of no more than the equivalent of the WaitInterval.

Garry.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Jan 28, 2009 12:35 am    Post subject: Re: CICS - WAIT or DELAY?
Reply with quote

You can make the DELAY cancellable (before actual expiration) via a CANCEL command, specifying a REQID and (optionally, but recommended) the TRANSID.

The CANCEL must be issued by a different task.

Bill
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts CICS to Webservices safexc CICS 1 Sun Jan 22, 2017 5:49 pm
No new posts CICS transaction slow response time vasanthz All Other Mainframe Topics 3 Thu Jan 19, 2017 1:31 am
No new posts INDEPENDENT CICS TS 4.1 MRO REGION UP... Kyle Carroll CICS 0 Wed Dec 14, 2016 6:55 pm
No new posts CICS START AND CANCEL blayek CICS 1 Wed Dec 07, 2016 3:27 am
No new posts How does a called pgm know if its cal... Graeme Westerman COBOL Programming 4 Tue Nov 29, 2016 9:25 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us