IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

CICS ENQ RESOURCE - Multiple Tasks - How sequencing done


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mak_tcs

New User


Joined: 23 Nov 2005
Posts: 69
Location: Minneapolis, MN USA

PostPosted: Fri Jul 17, 2015 2:29 pm
Reply with quote

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
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Fri Jul 17, 2015 4:30 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Fri Jul 17, 2015 8:11 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Calling an Open C library function in... CICS 1
Search our Forums:

Back to Top