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

Using ENQ in one program and DEQ in another.


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

New User


Joined: 22 Feb 2010
Posts: 56
Location: Cochin

PostPosted: Sat Jul 25, 2015 2:47 am
Reply with quote

Hi,

I am using ENQ in one of the program as below and trying to use DEQ in another for the same Resource Value.

ENQ Value in both cases is exactly same. Is it allowed to ENQ in one program and DEQ in another both programs running in same LPAR ?

In Program 1 I am using :

Code:
EXEC CICS                       
     ENQ                       
     RESOURCE (WS-ENQ-VALUE)   
     LENGTH   (WS-ENQ-LENGTH)   
     RESP     (WS-RESP)         
     TASK                       
     NOSUSPEND                 
END-EXEC.                       


In Program 2 I am using :

Code:
EXEC CICS DEQ                     
     RESOURCE (WS-ENQ-VALUE)     
     LENGTH   (WS-ENQ-LENGTH)     
     RESP (WS-RESP)               
END-EXEC.                         
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Jul 25, 2015 3:24 am
Reply with quote

ENQ and DEQ are supposed to work as a pair in a program. Depending upon the specific situation, what you are wanting to do may - or may not - work.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Jul 25, 2015 5:56 am
Reply with quote

Also, I notice that you did NOT indicate you are having any issues, nor what the RESPONSE codes are for each command, you just asked if it is allowed. And the answer is generally, as long as the programs are in the same task / UOW (depending upon the ENQ parameter) then it should work -- but I haven't tested this so I don't know for sure. If the programs are not in the same task / UOW, then almost certainly what you are attempting to do will not work. As I posted earlier, it may -- or may not -- work depending upon the specific situation.

And your question is quite broad -- two programs running in the same LPAR could be running in different CICS regions, in which case the answer, of course, will be that this CANNOT work since the programs CANNOT be in the same task / UOW.
Back to top
View user's profile Send private message
seahawk789

New User


Joined: 22 Feb 2010
Posts: 56
Location: Cochin

PostPosted: Sat Jul 25, 2015 9:48 am
Reply with quote

Sorry for not being specific. Both the programs run in the same CICS region. In that case the above scenario should work right ?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Sat Jul 25, 2015 2:11 pm
Reply with quote

Why not try it and find out? That is what test regions are for.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Jul 25, 2015 5:52 pm
Reply with quote

Quote:
In that case the above scenario should work right ?
How many times do you want the question answered? It may -- or may not -- work depending upon the specific situation. As Nic said, test it yourself so you will know the answer.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Mon Jul 27, 2015 6:26 pm
Reply with quote

I agree with the previous consensus. The same ENQ resource matched with the same DEQ resource in different regions (within the same LPAR) will not work. If in the same region, I don't see a problem.

Internal Resource Tables are Region specific. Unfortunately, there isn't a SYSID keyword option in the ENQ/DEQ API's.

What are you attempting?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Jul 27, 2015 7:39 pm
Reply with quote

seahawk789: What you have not explained is how program 1 and program 2 are related. I think you want a simple yes / no answer, but you cannot have a yes / no answer because the answer depends upon how the programs are related. If they are totally distinct and separate (as in running in two different tasks), I believe you will find this won't work since the end of task will release the ENQ without requiring the DEQ to process -- and therefore the DEQ would not have a normal response since there's no associated ENQ. If program 1 and program 2 are both associated with a single task (via XCTL or LINK) then yes it will work as long as there's no intervening EXEC CICS RETURN to force the end of task.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Mon Jul 27, 2015 8:26 pm
Reply with quote

That should work, and however if the previous ENQ task is completed (XCTL) or any Syncpoint is issued then, it anyways gets deq'ed by default.

Moreover, please go through this to understand the scope of ENQ'ed transaction.

www-01.ibm.com/support/knowledgecenter/#!/SSGMCP_4.2.0/com.ibm.cics.ts.applicationprogramming.doc/topics/dfhp3ly.html?cp=SSGMCP_4.2.0%2F11-3-5-2-2

www-01.ibm.com/support/knowledgecenter/#!/SSGMCP_5.1.0/com.ibm.cics.ts.applicationprogramming.doc/commands/dfhp4_deq.html
Back to top
View user's profile Send private message
seahawk789

New User


Joined: 22 Feb 2010
Posts: 56
Location: Cochin

PostPosted: Wed Jul 29, 2015 6:32 am
Reply with quote

Thanks all for your help.
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 DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top