View previous topic :: View next topic
|
Author |
Message |
mak_tcs
New User
Joined: 23 Nov 2005 Posts: 69 Location: Minneapolis, MN USA
|
|
|
|
Hi All,
I have multiple CICS tasks triggered from an external party and I need to processes them in sequence. Let's say TASK1 & TASK2 are triggered, I process them sequentially using Global ENQ as given below
EXEC CICS
ENQ RESOURCE (WS-ENQ-KEY)
LENGTH (WS-ENQ-KEY-LNTH)
NOHANDLE
TASK
END-EXEC
It may happen so that TASK2 reaches my server before TASK1 but I have to process TASK1 first before TASK2.
I am thinking of the below approach to fix this issue:
1. TASK2 got ENQ'd and TASK1 is waiting
2. In TASK2, check if TASK1 already executed.
3. If TASK1 not executed still, then issue DEQ and issue ENQ again (coded inside Task2)
My expectation is that when I DEQ, TASK2 is DEQ'd (but not over yet) and TASK1 will get ENQ'd and gets completed. TASK2 will get processed once TASK1 is over.
Please post your opition and revert if you have a better solution.
Thank you. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
How do you know that a given TASK1 relates to a given TASK2 ?
What time could elapse between a given TASK2 arriving and its associated TASK1 arriving (where they arrive out of sequence) and how do propose to handle an excessive time interval? The same applies where TASK1 arrives and is processed but TASK2 never arrives or arrives too late.
Can there be multiple sets of TASK1 and TASK2 interleaved?
Garry |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
Hi,
Correct the source, why is task2 is coming up early then task1 ? should this not be listed as a part of your requirement? is it a bug?
Quote: |
3)If TASK1 not executed still, then issue DEQ and issue ENQ again (coded inside Task2) |
What is the interval between these two tasks? what if task1 doesn't comein given interval ? what happens to task2?
So it is a FIFO, ask an external party to correct this issue.
How big is the commarea? if you have a DB2 then save them else save it on a file or TSQ. Now using START you can trigger a process which will read this tasks and untill task1 and task2 or only task1 is found execute it otherwise find what is time interval you want to wait for task1 and if it does not come then rollback task2 and inform your third party about why task1 is missed? |
|
Back to top |
|
|
|